兼容浏览器方式:
<html>
<body>
<script>
document.οnkeydοwn=function(e){
var keycode=document.all?event.keyCode:e.which;
if(keycode==13){
alert("Enter");
}
}
</script>
</body>
</html>
兼容浏览器方式:
<html>
<body>
<script>
document.οnkeydοwn=function(e){
var keycode=document.all?event.keyCode:e.which;
if(keycode==13){
alert("Enter");
}
}
</script>
</body>
</html>