代码如下:
<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>