jQuery click()

The jQuery click () method is executed once the click event occurs. Syntax: To trigger the click event for the selected elements. (selector).click()Toattachafunctiontotheclickevent.Example1:<!DOCTYPEhtml><html><head><scriptsrc=https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js></script><script> (document).ready(function(){ $(“h1,h2”).click(function(){ $(this).hide(); }); }); </script> </head> <body> <h1>Click me. I am a ghost.</h1> <h2>Me too.</h2> … Read more