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/
Commentaires (0)
Laisser un commentaire
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Chargement des commentaires...