Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

adding event on enter key keypress in javascript

const elem = document.getElementById("input");

elem.addEventListener("keypress", (event)=> {
    if (event.keyCode === 13) { // key code of the keybord key
      event.preventDefault();
	 // your code to Run
    }
  });
Source by www.woodstitch.com #
 
PREVIOUS NEXT
Tagged: #adding #event #enter #key #keypress #javascript
ADD COMMENT
Topic
Name
1+5 =