<button type=button id=mybutton>Toggle</button> <div id=mything>Hello</div> <script src=jquery.js></script> <script> $('#mybutton').click(function() { $('#mything').toggle(); }); </script>
Programming Tips - jquery: alternately show and hide an HTML element
Date: 2014dec6
Library: jQuery
Q. jquery: alternately show and hide an HTML element
A. Use jQuery's toggle like this: