JQuery Hide All Element

  1. C<!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>  
  5. <script>  
  6. $(document).ready(function(){  
  7.     $("button").click(function(){  
  8.         $("*").hide();  
  9.     });  
  10. });  
  11. </script>  
  12. </head>  
  13. <body>  
  14. <div> This is div element</div>  
  15. <h2>This is a heading element</h2>  
  16. <p>This is a paragraph element</p>  
  17. <span>This is span elment</span>  
  18.   
  19. <button>Click To Hide All Element</button>  
  20.   
  21. </body>  
  22.  </html>  
Check the below mention code, 
  1. $(document).ready(function(){  
  2.     $("button").click(function(){  
  3.         $("*").hide();  
  4.     });  
  5. });