click() and dblclick()

click() : Fire when mouse single click on the matched element.

dblclick() : Fire when mouse double clicks on the matched element.

Example :

$(‘#singleClick’).click(function(){

$(‘#singleClick’).css(“border”, “1px solid red”);

});

$(‘#doubleClick’).dblclick(function(){

$(‘#doubleClick’)..css(“border”, “1px solid blue”);
});

Note :

Step 1: Element has id as “singleclick”  will apply border as red ( single click ).
Step 2: Element has id as  “doubleClick”  will apply border as blue in ( double click ).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.