javascript event e.which? -
What is the functionality of javascript event e? Collapse with example.
e Which is not an event, which is a property of the event object, which most people call their event handler as e It contains the key code of the key that was pressed to trigger the event (like: keydown, key).
document.onkeypress = function (myEvent) {// does not have to be "e" console.log (myEvent.which); }; With that code, the console will print the code of the key pressed on your keyboard.
Comments
Post a Comment