Get key code in key down event (IE) : Key Event « Event « JavaScript DHTML
- JavaScript DHTML
- Event
- Key Event
Get key code in key down event (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>
Related examples in the same category