Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript key event

// Add event listener on keydown
document.addEventListener('keydown', (event) => {
  var name = event.key;
  var code = event.code;
  // Alert the key name and key code on keydown
  alert(`Key pressed ${name} 
 Key code value: ${code}`);
}, false);
Comment

js key event

window.addEventListener("keyup", function(event) {
    if (event.key == 'Escape'/*Your key*/) {
        // do something
    }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: date match mongodb 
Javascript :: convert text to qr code in angular 
Javascript :: queryselector for jquery 
Javascript :: React native pdf creater html-to-pdf 
Javascript :: nodejs get cpu count 
Javascript :: The document.createElement() Method 
Javascript :: multilone input html 
Javascript :: create record mongoose model 
Javascript :: node js 
Javascript :: how to check whether we are running on electron or browser 
Javascript :: electron 
Javascript :: has class in jquery 
Javascript :: inline style to change background color javascript 
Javascript :: proxy api javascript set 
Javascript :: js how to filter range in place 
Javascript :: polyfill for call 
Javascript :: e parameter in javascript 
Javascript :: events in javascript 
Javascript :: javascript constructor 
Javascript :: javascript identifiers 
Javascript :: typescript compile string to js 
Javascript :: inbox 
Javascript :: return two arrays javascript 
Javascript :: jquery with svelte 
Javascript :: make custom draggable in react 
Javascript :: Authentication handling in javascript 
Javascript :: every element in list after first javascript 
Javascript :: promises in javascript 
Javascript :: js data types 
Javascript :: jq not contains 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =