VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-click-method/

⇱ jQuery click() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery click() Method

Last Updated : 11 Jul, 2025

jQueryclick() is an inbuilt method that starts the click event or attaches a function to run when a click event occurs. 

Syntax:

$(selector).click(function);

Parameters:

It accepts an optional parameter "function" which is used to run when a click event occurs. 

jQuery examples to show the working of click() method:

Example 1: In the below code, no function is passed to this method. 

Output:

👁 Image

Example 2: In the below code, the function is passed to this method. 

Output:

👁 Image
Comment
Article Tags:

Explore