Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js enter key event listener

document.getElementById("yourElementId").addEventListener("keypress", function (event) {
    if (event.key === "Enter") {
       // the code you want to run
    }
})
 
PREVIOUS NEXT
Tagged: #js #enter #key #event #listener
ADD COMMENT
Topic
Name
9+9 =