按钮与回车键关联的js代码
(编辑:jimmy 日期: 2024/11/14 浏览:2)
复制代码代码如下:
<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>