用jquery写,
$(function(){ $("body,html").keyup(function(event){ //event.keyCode==13{ //注意兼容性 $("button").click(function(){ //doMethod(); }); } });})