Answers for "input key press event"

10

html onkeypress

<input type="text" onkeypress="myFunction()">
Posted by: Guest on July-10-2020
0

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
});
Posted by: Guest on November-18-2020

Code answers related to "input key press event"

Browse Popular Code Answers by Language