Javascript examples for jQuery Method and Property:toggle
Toggle in 1 second
<!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(1000); });//w ww . ja v a 2 s . c o m }); </script> </head> <body> <button>Toggle between hide and show for a p element</button> <p>This is a paragraph.</p> </body> </html>