Javatpoint Logo
Javatpoint Logo

jQuery click()

When you click on an element, the click event occurs and once the click event occurs it execute the click () method or attaches a function to run.

It is generally used together with other events of jQuery.

Syntax:

It is used to trigger the click event for the selected elements.

It is used to attach the function to the click event.

Let's take an example to demonstrate jQuery click() event.

Test it Now

Output:

Click on the statement.

Let's take an example to demonstrate the jquery click() event. In this example, when you click on the heading element, it will hide the current heading.

Test it Now

Output:

This heading will disappear if you click on this.

I will also disappear.

Me too.

Next TopicjQuery bind()




Let's Work Together!

Javatpoint is passionate to offer better content to the world. Please mail your contribution to contribute@javatpoint.com. We will show your name and create your user profile. You can contribute the following things:
  • Article on Any Topic (which is not available on Javatpoint)
  • Your Interview Experience on Company
  • Company Interview Questions with Answers
  • Recruitment Process of Company
  • Programs, and Algorithm
  • Videos
  • Test Paper
  • Improve Article

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials