javascript on key input code example
Example 1: js when key is pressed
document.addEventListener("keypress", function(event) {
// do stuff
});
Example 2: javascript on keypu
<input type="text" onkeyup="myFunction()">
document.addEventListener("keypress", function(event) {
// do stuff
});
<input type="text" onkeyup="myFunction()">