<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> </title> <script src="/jquery.min.js"> </script> <script> $(document).ready(function(){ $("form").submit(function(){ alert("submit is ok"); return false; }); $("button").click(function(){ //获取 对应的id,到ids if(false){ $("form").submit(); }else{ console.log('参数不全'); } }); }); </script> </head> <body> <!-- 隐藏域的input --> <form action=""> <input type="hidden" name="username" value="test"><br> </form> <button>提交</button> </body> </html>