Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
            }
        }
Source by # #
 
PREVIOUS NEXT
Tagged: #Javascript #form #check #return #enter #pressed
ADD COMMENT
Topic
Name
1+2 =