Easy Tutorial
❮ Misc Jquery Sub Sel Attribute Contains String Value ❯

jQuery click() Method

jQuery Event Methods

Example

Alert text when a <p> element is clicked:


Definition and Usage

The click event occurs when an element is clicked.

The click() method triggers the click event or specifies a function to run when a click event occurs.


Syntax

Trigger the click event for the selected elements:

Attach a function to the click event:

Parameter Description
function Optional. Specifies the function to run when the click event occurs.

jQuery Event Methods

❮ Misc Jquery Sub Sel Attribute Contains String Value ❯