Click Event


The click event occurs when a user clicks on an element.

It is one of the most commonly used events in jQuery.

Click events are mostly used for buttons, links, icons, and menu items.

This code runs when the button with ID btn is clicked.

The this keyword refers to the element that was clicked.

It is very useful when working with multiple elements.

Click events are often used to show or hide content dynamically.

Click Event Notes:

  • Triggered by mouse click
  • Works on buttons and elements
  • this refers to clicked element
  • Most used jQuery event