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 :: formdata array of objects 
Javascript :: node app 
Javascript :: how to enable click copy function using js 
Javascript :: angular pipe percentage 
Javascript :: how to get value of html element in javascript 
Javascript :: react native webview not working 
Javascript :: javascript get sub array 
Javascript :: laravel http send data json raw 
Javascript :: how to remove a specific element from array in javascript 
Javascript :: javascript tofixed no trailing zeros 
Javascript :: optional chaining javascript 
Javascript :: scroll to top 
Javascript :: jquery change button click function 
Javascript :: javascript throw error inside then 
Javascript :: generate express js project 
Javascript :: how to play sound on load js 
Javascript :: replace object in array with another array with same id javascript 
Javascript :: javascript fs write file with folder 
Javascript :: localstorage try catch 
Javascript :: closure in js 
Javascript :: floating button react 
Javascript :: how to remove more than one attribute using jquery 
Javascript :: form.select not working react bootstrap 
Javascript :: check Browser version js 
Javascript :: date.parse string to javascript 
Javascript :: select selected option value jquery 
Javascript :: upload image to firebase 
Javascript :: dropify use 
Javascript :: store images in mongoose 
Javascript :: how to convert jsonobject to string in java 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =