144
rated 0 times
[
147]
[
3]
/ answers: 1 / hits: 21807
/ 13 Years ago, tue, june 28, 2011, 12:00:00
I googled and got the following codes on the Net.However, when I press a keyboard key,it is not displaying me an alert box. I want to get which character I have pressed in the alert box. How do I fix this?
<script type=text/javascript>
var charfield=document.getElementById(char)
charfield.onkeydown=function(e){
var e=window.event || e;
alert(e.keyCode);
}
</script>
</head>
<body id=char>
</body>
</html>
More From » html