标签:
1 <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> 2 <script type="text/javascript"> 3 $(function () { 4 $(‘form‘).submit(function () { 5 return false; 6 }); 7 $(document).keyup(function(event){ 8 if (event.keyCode == 13){ 9 if (true) {//逻辑判断 10 document.forms[0].submit(); 11 } 12 } 13 }); 14 }) 15 </script> 16 <form id=‘myform‘> 17 <input type="text"> 18 <input type="submit"> 19 </form>
标签:
原文地址:http://www.cnblogs.com/lman/p/4924187.html