//回车的键值为13 function document.onkeydown(){ if (event.keyCode == 13) { //js 监听对应的id document.getElementById("login_1").click(); return false ; } } function loginSystem() { if(!(submitForm()) ) { return false; } //表单提交 document.dataForm.submit(); }
<div id="btn"><a href="javascript:void(0);" id="login_1" οnclick="loginSystem()">登录</a><a href="javascript:void(0);" οnclick="clearSystem()">清空</a></div>
from 表单提交
<form name="dataForm" method="post" action="loginAction.do?method=checkUser">
button css 文件
#btn{margin-left:30px; margin-top:40px;height:25px; margin-right:28px; text-align:center;}
#btn a{display:block; line-height:25px; background: url(bt_bg.gif); border: solid 1px #b6b6b6; width:65px; float:left; margin-left:15px; text-decoration:none; color:#000;}
js 输入改变事件
onpropertychange="seach()"