javascript simulate escape key press 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
}
});