how to add a right click listener javascript
element.addEventListener('contextmenu', (e) => {
e.preventDefault();
alert('Success');
}, false);
how to add a right click listener javascript
element.addEventListener('contextmenu', (e) => {
e.preventDefault();
alert('Success');
}, false);
javascript event right click
function rightclick() {
var rightclick;
var e = window.event;
if (e.which) rightclick = (e.which == 3);
else if (e.button) rightclick = (e.button == 2);
alert(rightclick); // true or false, you can trap right click here by if comparison
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us