Unicode popup on key event trigger


HTML • JavaScript


<html>
<head>
<title>which key</title>

<script type="text/javascript">
<!--
function whichButton() {
      document.onkeyup= function (event) {
            if(!event) {
                  event=window.event;
                  alert(window.event.keyCode);
            } else {
                  alert(event.which);
            }
      }
}

onload=whichButton;
//-->
</script>

</head>
<body>

<p>
      Press a key on your keyboard. An alert box will alert the unicode of the key pressed.
</p>

</body>
</html>

Posted by fbrefere001 on Wednesday May 31, 2006