Skip to main content
Sep 01, 2013

At the first place we need to assume that our HTML code contains the code:

<div id="buttondiv">Button</div>
<p>Press Mouse Button over the "Button" text above</p>

Next step is to add jQuery code to check which mouse button is clicked:

$(document).ready(function() {
            $('p').text('Left button is clicked.');
        } else {
            $('p').text('Right button is clicked');