<html>
<body>
<p>Press the Escape/Esc key on the keyboard (usually in the top left corner) in the input field, to alert some text.</p>
<input type="text" size="50" onkeydown="myFunction(event)">
<script>
function myFunction(event) {
var x = event.which || event.keyCode;
if (x == 27) {
alert ("You pressed the Escape key!");
}
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_key_which3 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:40:08 GMT -->
</html>