當(dāng)前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
JS获取按键码
<script language="javascript">
function keyDown()
{
var keycode=event.keyCode;
var keychar=String.fromCharCode(keycode);
alert('ASCII='+keycode+'\nKeyChar='+keychar);
}
document.οnkeydοwn=keyDown;
</script>
function keyDown()
{
var keycode=event.keyCode;
var keychar=String.fromCharCode(keycode);
alert('ASCII='+keycode+'\nKeyChar='+keychar);
}
document.οnkeydοwn=keyDown;
</script>
轉(zhuǎn)載于:https://www.cnblogs.com/weiqt/articles/1986284.html
總結(jié)
- 上一篇: mySql完全手册2011031401
- 下一篇: 【Cson原创】javascript中l