Home >>jQuery Tutorial >jQuery click() Events

jQuery click() Events

jQuery click() Events

jQuery click() Events in jQuery is used to triggers the click event, or attaches a function to run when a click event occurs, it occurs when element is clicked.


Trigger the click event for the selected elements: $(selector).click()
Attach a function to the click event: $(selector).click(function)

Parameter Values

Parameter Description
function It is optional and is used to Specifies the function to run when the click event occurs

Here is an Example of jQuery click() Method:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
alert(" paragraph was clicked :)");
<p class="txt">Click Here!!!!</p>


Click Here!!!!

No Sidebar ads