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 :: bootstrap 4 navbar-collapse not working angular 
Javascript :: correct json type 
Javascript :: How to loop through an object in JavaScript with a for…in loop 
Javascript :: angular json to file and download 
Javascript :: javascript download current html page 
Javascript :: download json file react 
Javascript :: javascript break for loop 
Javascript :: react native floating button 
Javascript :: node mysql 
Javascript :: bs modal service close 
Javascript :: send a message using discord.js 
Javascript :: retrieve data from option select js 
Javascript :: particles js is not full screen 
Javascript :: loop an object in javascript 
Javascript :: check if numbers are consecutive javascript 
Javascript :: import modules js html 
Javascript :: watch with multiple variables vuejs 
Javascript :: add formdata javascript 
Javascript :: javascript eval passing variable 
Javascript :: math floor 
Javascript :: node js cross origin error 
Javascript :: loop elements in javascript 
Javascript :: Vue.use is not a function 
Javascript :: get last word in string js 
Javascript :: convert date to string javascript 
Javascript :: express receive post 
Javascript :: change px string to number 
Javascript :: remove backslash from string 
Javascript :: puppeteer mac m1 
Javascript :: date range filter 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =