jQuery click() Method - CodingTag

jQuery click()

0 1036

  • When a user clicks on the HTML element, the click() function is executed which attaches an event handler method to that particular HTML element.
  • Most of the time, this event is used together with other events of jQuery.

Related Topics:

jQuery Installation
jQuery Syntax

jQuery Click


//actions go here


selector represents a jquery selector that is used to select the HTML element on which the events occur.


In this example, the paragraph will disappear after a click on it.

<title> jQuery Example </title>
<script type = "text/javascript"


<h2> jQuery Click Event Example </h2>

<p>click on me to hide me.</p>
<p>click on me to hide me.</p>
<button class="bt"> Click me to change the color of background </button>



Click on paragraphs to hide them and click on the button to change the background color.

Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments