日期:2014-05-16 浏览次数:20372 次
function keyUp(e) { var currKey=0,e=e||event; currKey=e.keyCode||e.which||e.charCode; var keyName = String.fromCharCode(currKey); alert("按键码: " + currKey + " 字符: " + keyName); } document.onkeyup = keyUp;
?
?
function text(event){ var browser; if (document.all) browser = "IE"; else browser = "FF"; if(browser == "IE"){ key = event.keyCode; }else{ key=event.which; } alert(key); }
?
?
?