Quantcast
Channel: jQuery
Viewing all articles
Browse latest Browse all 11

Responding to various mouse clicks with jQuery

$
0
0

Mouse has been the primary medium of input for decades. Normally there are three types of mouse click. They are left, right and middle click.

In jQuery, we all knew there is a click() method acts as event handler to capture this action. 

$(selector).click();

But how to capture a specific click. For example, if we want to make some change only on left click or only on right click. 

Of course, the common click() handler will not help us in this case. So we need to move for targeting specfic click event.

But how to capture this specific click action. Is it possible? Yes it is with below code snippet,


Viewing all articles
Browse latest Browse all 11

Trending Articles