Show and Hide div on single button click using jquery

  1. <!doctype html>  
  2. <html lang="en">  
  3.   
  4.     <head>  
  5.         <meta charset="utf-8">  
  6.         <title>toggle demo</title>  
  7.         <script src="https://code.jquery.com/jquery-1.10.2.js"></script>  
  8.     </head>  
  9.   
  10.     <body>  
  11.         <button>Toggle</button>  
  12.         <div>Hello</div>  
  13.         <script>  
  14.             $("button").click(function()  
  15.             {  
  16.                 $("div").toggle();  
  17.             });  
  18.         </script>  
  19.     </body>  
  20.   
  21. </html>