Answers for "type on pressing any key html js"

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 "type on pressing any key html js"

Browse Popular Code Answers by Language