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
    }
})
Source by stackhowto.com #
 
PREVIOUS NEXT
Tagged: #js #enter #key #event #listener
ADD COMMENT
Topic
Name
9+7 =