javascript:
function check_keyPress(e){
(1)
if ($.browser.msie){ //ie
keycode = event.keyCode;
}else{ //其它
keycode = e.which;
}
alert(keycode);
PS.發現無法判斷上、下、左、右鍵
(2)
var keycode = (e.which) ? e.which : event.keyCode
}
html:
<input type="text" name="text1" value="" size="5" onkeypress="check_keyPress(event)">
沒有留言:
張貼留言