1、document.onkeydown=function(e){
var keycode=document.all?event.keyCode:e.which;
if(keycode==13){
//doSomeThing
};
}
2、 document.onkeydown = function (event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 13) {
//doSomeThing
}
};