document.onkeydown=function(event){
e = event ? event :(window.event ? window.event : null);
if(e.keycode==13){
//执行的方法
alert('回车检测到了');
}
}
</script>
<script>
document.onkeydown=function(event){
e = event ? event :(window.event ? window.event : null);
if(e.keycode==13){
//执行的方法
alert('回车检测到了');
}
}
</script>
[javascript] <script>
$(document).ready(function(){
$("按下回车的控件").keydown(function(e){
var curkey = e.which;
if(curkey == 13){
$("#回车事件按钮控件").click();
return false;
}
});
});