<script type=""text/javascript>
function $(eleId){ //使用$作为方法名,通过元素的ID获取元素内容
return document.getElementById(eled);
}
document.onkeydown = function(e){ //onkeydown:键盘的键被按下的事件
alert(e.keyCode);
}
</script>
<script type=""text/javascript>
function $(eleId){ //使用$作为方法名,通过元素的ID获取元素内容
return document.getElementById(eled);
}
document.onkeydown = function(e){ //onkeydown:键盘的键被按下的事件
alert(e.keyCode);
}
</script>