事件为 onKeydown()
可以放到body内
<body onkeydown="方法名(event)">
</body>
也可以为某个标签
<button on...><>
事件兼容:
//搜索回车实现单击效果 //兼容 IE 火狐 谷歌 function 方法名(e) { if (!e) e = window.event; if ((e.keyCode || e.which) == 13) { xxx; } }