<div class="codetitle"> <span><a style="CURSOR: pointer" data="89846" class="copybut" id="copybut89846" onclick="doCopy('code89846')"><u>複製程式碼</u></a></span> 代碼如下:</div> <div class="codebody" id="code89846"> <br>login_form為表單ID名稱。這裡只是實作回車表單提交<br><br>$("#login_form").keypress(function(e) { <br><br>if (e.which == 13) { <br>$(" #login_form").submit(); <br>} <br>}); <br><br>$(window).keydown(function (e) { <br>if (e.which == 13) { <br>return false; <br>} <br><br>}) <br> </div>