- C<!DOCTYPE html>
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script>
- $(document).ready(function(){
- $("button").click(function(){
- $("*").hide();
- });
- });
- </script>
- </head>
- <body>
- <div> This is div element</div>
- <h2>This is a heading element</h2>
- <p>This is a paragraph element</p>
- <span>This is span elment</span>
-
- <button>Click To Hide All Element</button>
-
- </body>
- </html>
Check the below mention code,
- $(document).ready(function(){
- $("button").click(function(){
- $("*").hide();
- });
- });