js判断回车,区分IE,火狐,谷歌
if(document.addEventListener){//如果是Firefox document.addEventListener("keypress",fireFoxHandler, true); }else{ document.attachEvent("onkeypress",ieHandler); } function fireFoxHandler(evt){ if(evt.keyCode==13){ com_search(); } } function ieHandler(evt){ if(evt.keyCode==13){ com_search(); } }