Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript detect enter press on input

var el = document.getElementById("myInputID");
el.addEventListener("keydown", function(event) {
    if (event.key === "Enter") {
        // Enter key was hit
    }
});
Comment

how to check if enter is pressed javascript

$('#usersearch').keydown(function(e){
    if(e.keyCode === 13){
            alert("Enter was pressed ");
     }  
});
Comment

Javascript form check to see if return or enter was pressed

function handleKey(ev) {
            console.log(ev.type.toUpperCase(), ev.target.id, ev.target.value);
            let code = ev.keyCode || ev.which;
            if (code == 10 || code == 13) {
                //return or enter key
                handleSend(ev);
            }
        }
Comment

PREVIOUS NEXT
Code Example
Javascript :: sequelize generate migration 
Javascript :: js appendchild wait for callback 
Javascript :: get select option count using jquery 
Javascript :: image next src url 
Javascript :: javascript change color for class name 
Javascript :: jquery sort select options by text 
Javascript :: mongodb add user 
Javascript :: convert stream to string javascript 
Javascript :: randome words api 
Javascript :: jquery set input checked 
Javascript :: js urlencode 
Javascript :: js percorrer objeto 
Javascript :: field options mongoose 
Javascript :: jquery uncheck checkbox 
Javascript :: getting user input in node js 
Javascript :: pdf.js cdn 
Javascript :: regex for first three characters 
Javascript :: check if radio button is checked 
Javascript :: nextjs tailwind 
Javascript :: how to ask input in javascript 
Javascript :: module not found reactstrap 
Javascript :: javascript check if all capital letter 
Javascript :: create an array of numbers by numbers range in angular 
Javascript :: js add value to html input 
Javascript :: javascript loop through array 
Javascript :: js is letter 
Javascript :: jquery grid disable sorting 
Javascript :: login to discord using token 
Javascript :: jquery change selected option to first 
Javascript :: javascript get all select options 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =