Use String.fromCharCode to convert key event code to key event char (IE) : Key Event : Event JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Event » Key Event »

 

Use String.fromCharCode to convert key event code to key event char (IE)

















<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
function press()
{
    var char;
    char = String.fromCharCode(event.keyCode);
    window.status = "You pressed " char;
}
//  -->
</script>
</head>
<body onkeydown="press()">

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Event
» Key Event