Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

adding event listener keypress event in javascript

let msg = document.getDocumentById('#message');

msg.addEventListener("keydown", (event) => {
    // handle keydown
});

msg.addEventListener("keypress", (event) => {
    // handle keypress
});

msg.addEventListener("keyup", (event) => {
    // handle keyup
});
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #adding #event #listener #keypress #event #javascript
ADD COMMENT
Topic
Name
4+8 =