javascript check if escape key was pushed 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
}
});