Javascript examples for jQuery Method and Property:click
Attach a function to the click event:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("p").click(function(){ $(this).fadeOut();/*from ww w .j ava2 s .c o m*/ }); }); </script> </head> <body> <p>Click this paragraph to make it disappear.</p> </body> </html>