'keyCode' Example : Key Event : Event onMethod JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Event onMethod » Key Event »

 

'keyCode' Example



<html>
<body>
<script language="JavaScript">
    function function1(evt) {
        evt = (evt) ? evt : (window.event) ? window.event : "";
        x =evt .keyCode; alert("Unicode Value: "+x);
    }
    function function2(evt) {
          evt = (evt) ? evt : (window.event) ? window.event : "";
        x =  evt .keyCode; alert("Keyboard Value: "+x);
    }
</script>
<p>Press Any Key</p>
<body onKeyDown="function2(event);" onKeyPress="function1(event);">
</body>
</html>


-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Event onMethod
» Key Event