how to detect esc key in javascript code example
Example: javascript detect escape key
document.addEventListener('keydown', function(event){
if(event.key === "Escape"){
//do something
}
});
document.addEventListener('keydown', function(event){
if(event.key === "Escape"){
//do something
}
});