Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

handle esc press js

//Check if the key is the Escape key, also known as 27 in the ASCII table
const pressEsc = (event) => {
	if(event.key === "Escape"){
    	console.log("You pressed Esc button")
    }
}

//Listen to the global keydown, the callback function will give us the wanted result
window.addEventListener("keydown", pressEsc)
Comment

PREVIOUS NEXT
Code Example
Javascript :: array chunk javascript 
Javascript :: javascript match number 
Javascript :: js convert string to script 
Javascript :: how to change the font family using jquery 
Javascript :: how to check if iframe is loaded 
Javascript :: delete duplicates array of strings Javascript 
Javascript :: .map for object javscript 
Javascript :: ipv4 to int32 js 
Javascript :: js date locale brasil 
Javascript :: console.log red text on yellow background 
Javascript :: cannot find module loader 936 
Javascript :: checking if var is not defined js 
Javascript :: how remove child in jquery 
Javascript :: set interval react 
Javascript :: jquery get top position of element on scroll 
Javascript :: angular version command 
Javascript :: regExp for finding a first letter and last letter in a string 
Javascript :: how to pronounce allele 
Javascript :: is intersectionobserver supported in browser 
Javascript :: scroll to bottom of a div react 
Javascript :: ngcc failed angular 9 
Javascript :: js addeventlistener click 
Javascript :: datatable row color 
Javascript :: get element by xpath in javascript 
Javascript :: Error: EACCES: permission denied, 
Javascript :: checking if a character is an alphabet in js 
Javascript :: how to make graphql request in axios 
Javascript :: parse date do weekday 
Javascript :: how to create a new react native project 
Javascript :: jquery get value by name 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =