Javascript examples for jQuery:Hide
Toggle between hiding and showing the <p> element when you click on the "Toggle" button.
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").toggle(); });/*from ww w . j a v a 2s .c om*/ }); </script> </head> <body> <button>Toggle</button> <p>This is a paragraph.</p> </body> </html>