Answers for "user pressed key in javascript"

10

html onkeypress

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

js keyboard input

document.addEventListener('keydown', function(event) {
    if(event.keyCode == 37) {
        alert('Left was pressed');
    }
    else if(event.keyCode == 39) {
        alert('Right was pressed');
    }
});
Posted by: Guest on August-17-2020

Code answers related to "user pressed key in javascript"

Browse Popular Code Answers by Language