<input name="checkCode" type="text" class="input_text" size="12" onKeyPress="return listerPress(event);" />
<input id="ok" name="ok" type="button" onClick="" />
<script language="javascript">
function listerPress(e)
{
var e = e || window.event;
if(e.keyCode==13)
{
document.getElementById('ok').click();
return false;
}
}
</script>
触发回车事件,IE和火狐 都支持,13 - 回车键