I have the following code:
document.oncontextmenu = function(evt) { evt = evt || window.event; console.log(evt.target, evt.toElement, evt.srcElement); };
By right-clicking on the <div class="foo"></div> , return this:
div.foo, div.foo, div.foo
By right-clicking on the <input> , return this:
input, input, input
Everyone seems to bring the same result. Is there a situation where one of them has a different application than the others?
javascript javascript-events
Guilherme Nascimento Aug 6 '15 at 20:42 2015-08-06 20:42
source share