JS函数:获取按键keycode
JS函数:获取按键keycode
获取按键
<script language="javascript">
function keyDown()
{
var keycode=event.keyCode;
var keychar=String.fromCharCode(keycode);
alert('ASCII='+keycode+'\nKeyChar='+keychar);
}
document.onkeydown=keyDown;
</script>
用ENTET代替TAB
<script language="javascript">
function keyDown()
{
var keycode=event.keyCode;
var keyChar=String.fromCharCode(keycode);
if(keycode==13)
event.keyCode=9;
};
document.onkeydown=keyDown;
</script>
javascript:void(0)a