代碼如下:
<html>
<head>
<script language='javascript'>
function onEnterDown(){
if(window.event.keyCode == 13){
onButOk();
}
}
function onButOk(){
--按鈕的事件;
}
</script>
</head>
<body onkeydown='onEnterDown();'>
<input id="ButOk" type="button" accesskey="" value="登錄" onclick="onButOk()" />
</body>
</html>
更多信息請查看IT技術(shù)專欄