We help IT Professionals succeed at work.

Show and Hide table based on button click

puneet kumar
puneet kumar asked
on
how can i show and hide one table based on a button click in jsp page.
Comment
Watch Question

NoahHardware Tester and Debugger
CERTIFIED EXPERT

Commented:
Hi there! :)

There are many ways you can do this. One of the ways is to use document.getElementById('div'). You may refer to the link below, it may be useful.

Reference: https://www.roseindia.net/javascript/javascriptexamples/javascript-show-hide-table.shtml
Problem resolver
Commented:
See the way like

<script language="javascript">  
        function showMenu(elmnt)
        {
            document.getElementById(elmnt).style.visibility="visible";
        }
        function hideMenu(elmnt)
        {
            document.getElementById(elmnt).style.visibility="hidden";
        }   


    </script>   

Open in new window

CERTIFIED EXPERT
Top Expert 2016

Commented:
puneet kumar: a lot of your recent questions have as their answers something written in JavaScript. You need to know why and add that as a Topic Area to the questions or you might well miss good and correct answers

Author

Commented:
You guys are very helpful.