Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

JAVASCRIPT KEYDOWN AROW

document.onkeydown = checkKey;

function checkKey(e) {

    e = e || window.event;

    if (e.keyCode == '38') {
        // up arrow
    }
    else if (e.keyCode == '40') {
        // down arrow
    }
    else if (e.keyCode == '37') {
       // left arrow
    }
    else if (e.keyCode == '39') {
       // right arrow
    }

}
Comment

PREVIOUS NEXT
Code Example
Javascript :: check device in flutter 
Javascript :: how to create a folder in node js 
Javascript :: send file in patch axios react native 
Javascript :: conditional object spread 
Javascript :: test if multiple checkboxes are checked jquery 
Javascript :: regex date yyyy-mm-dd 
Javascript :: next js absolute path 
Javascript :: react toastify dark mode 
Javascript :: input onenter go to next input field javascript 
Javascript :: daterangepicker set maxdate 
Javascript :: jquery get all text inputs 
Javascript :: make contenteditable false javascript 
Javascript :: angular serve 
Javascript :: ecmascript 7 getmonth as 2 digits 
Javascript :: javascript convert number to string with 2 decimal places 
Javascript :: dynamic copyright year js 
Javascript :: javascript round down 
Javascript :: jspdf attach image file 
Javascript :: eslintrc ignore rule 
Javascript :: Vuejs watch for nested data 
Javascript :: scroll event js 
Javascript :: react-router-dom 
Javascript :: ajax failure response 
Javascript :: jquery change input value if greater than 
Javascript :: get random number node js 
Javascript :: get n number of elements from array javascript 
Javascript :: req body express 
Javascript :: css and js on flask 
Javascript :: array chaing in js 
Javascript :: mongoose get raw 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =