JavaScript get element that is right clicked
el.addEventListener('contextmenu', function(ev) {
ev.preventDefault();
alert('success!');
return false;
}, false);document.body.onclick = function (e) {
var isRightMB;
e = e || window.event;
if ("which" in e) // Gecko (Firefox), WebKit (Safari/Chrome) & Opera
isRightMB = e.which == 3;
else if ("button" in e) // IE, Opera
isRightMB = e.button == 2;
alert("Right mouse button " + (isRightMB ? "" : " was not") + "clicked!");
}
Also in PHP:
- create random unique password with php
- cache management laravel
- catch php exception
- check if string contains character php
- array key exist in phgp
- convert html to pdf php
- all cap in php
- convert date to timestamp in php
- cronjob set time
- drupal 8 entity_view
- check if array conttains key
- composer in laravel
- borrar cache en laravel
- debian install apache php
- HTTP 500 ERROR WITHOUT MESSAGE PHP
- PHP get access url
- PHP header(refresh)
- file_get_contents() [function.file-get-contents]: SSL operation failed with code 1. OpenSSL Error messages
- db seed laravle
- PHP if exists string
- Class 'App\Http\Controllers\Validator' not found in lumen
- check if array key exists
- +1 day in while php
- file_get_contents base64 php