x
 
<!DOCTYPE html>
<html>
<body>
<p>在输入字段中按键盘上的 Escape/Esc 键(通常在左上角),来提示一些文本。</p>
<input type="text" size="50" onkeydown="keyCode(event)"> 
<script>
function keyCode(event) {
  var x = event.keyCode;
  if (x == 27) {
    alert ("You pressed the Escape key!");
  }
}
</script>
</body>
</html>