<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript"> $(function () { $('form').submit(function () { return false; }); $(document).keyup(function(event){ if (event.keyCode == 13){ if (true) {//逻辑判断 document.forms[0].submit(); } } }); }) </script> <form id='myform'> <input type="text"> <input type="submit"> </form>