Hide all headings on a page when they are clicked

<!DOCTYPE html>

<html>

<head>

         <title></title>

         <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

</head>

<body>

 

         <h1>hello world</h1>

         <h1>carsf</h1>

<script type="text/javascript">

         $("h1").click(function()

         {

                 $("h1").hide();

         })

 

 

</script>

</body>

</html>


Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post