jQuery submit()
trigger submit event
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>//from ww w . ja v a2s . c o m <script> $(document).ready(function(){ $("form").submit(function(){ document.getElementById("demo").innerHTML = "Submitted"; }); $("button").click(function(){ $("form").submit(); }); }); </script> </head> <body> <p id="demo"></p> <form action=""> First name: <input type="text" name="FirstName" value="CSS"><br> Last name: <input type="text" name="LastName" value="HTML"><br> </form> <button>Trigger submit event</button> </body> </html>