Answers for "how to check if key was pressed js"

3

how to check if enter is pressed javascript

$('#usersearch').keydown(function(e){
    if(e.keyCode === 13){
            alert("Enter was pressed ");
     }  
});
Posted by: Guest on September-14-2020
13

js when key is pressed

document.addEventListener("keypress", function(event) {
	// do stuff
});
Posted by: Guest on March-08-2020

Code answers related to "how to check if key was pressed js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language