<!-- 這一段代碼阻止了當前document中的 enter鍵的 keydown 事件 抄自網絡-->
<script type="text/javascript"> document.onkeydown = function() { var evt = window.event || arguments[0]; if (evt && evt.keyCode == 13) { if (typeof evt.cancelBubble != "undefined") evt.cancelBubble = true; if (typeof evt.stopPropagation == "function") evt.stopPropagation(); return false; } return true; } </script>
<!-- 更加簡單粗暴的處理 在元素上定義 onkeydown方法 return false; -->
onkeydown="if(event.keyCode==13){return false;}