Javascript examples for jQuery Method and Property:toggle
Hide and show element with toggle()
<html> <head> <script src="https://code.jquery.com/jquery-1.9.1.js"></script> </head> <body> <button>Toggle</button> <p>Hello</p> <p style="display: none">Good Bye</p> <script> $("button").click(function (){ $("p").toggle(); });// w ww.j a v a 2 s . c om </script> </body> </html>