JavaScript mendeteksi kunci pelarian

document.addEventListener('keydown', function(event){
	if(event.key === "Escape"){
		//do something
	}
});
Friendly Hawk