check if a click is right click java code example
Example 1: javascript detect right click
el.addEventListener('contextmenu', function(ev) {
ev.preventDefault();
alert('success!');
return false;
}, false);
Example 2: jquery if else on click
$('#myElementID').click(function() {
var isSomethingTrue = true;
if(isSomethingTrue){
alert("something is true");
}else{
alert("something is false");
}
});