jQuery - click() method
The click() of jQuery is a simplified version of the JavaScript method .on("click",handler) and trigger("click"). The click event is sent to an element when the mouse pointer hovers over the element and when the button is pressed and released. Any element in HTML can receive and event.The click event is raised when an element is clicked.
The click() calls the click event when the click is detected.
Syntax:
Call the jQuery method click():$(selector).click()Attach a function to the click event:
$(selector).click(function)
Example
Here's an example of clicking on a < div> with the id 'target'. If you click the alert message appears.$( "#target" ).click(function() {
alert( "the element with the target id has been clicked");
});
References:
https://api.jquery.com/click/