javascript detect link click code example
Example 1: how to detect a button click in javascript
if(document.getElementById('button').clicked == true)
{
alert("button was clicked");
}
Example 2: javascript detect right click
el.addEventListener('contextmenu', function(ev) {
ev.preventDefault();
alert('success!');
return false;
}, false);