<html>
<head>
<title>测试绑定enter</title>
<script type="text/javascript"> function b_onclick() { alert("你好!"); } function BindEnter(obj) {
//使用document.getElementById获取到按钮对象
var button = document.getElementById('test');
if(obj.keyCode == 13)
{ alert("aa");
obj.returnValue = false;
}
}
</script>
</head>
<body οnkeydοwn="BindEnter(event)">
</body> </html>