Key press

We can read which key is pressed by user by reading window event. We need to use onkeydown to get arrow keys status. Here is the sample code to read key press
<script language='JavaScript' type='text/JavaScript'>
document.onkeypress = function(key_dtl) {
 key_dtl = key_dtl || window.event; 
var uni_code = key_dtl.keyCode || key_dtl.which; 
var key_name = String.fromCharCode(uni_code); 
alert(key_name); 
}
</script>

Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com




    Post your comments , suggestion , error , requirements etc here .




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer