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>
Visitors Rating
Your Rating





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-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer