How to use jQuery .submit() to handle the submit event on HTML <form> element

1 Answer

0 votes
<!doctype html>
<html>
<head>
  <script src="js/jquery/1.11.3/jquery.min.js"></script>
</head>
<body>

<form id="id-form" action="http://www.workingframe.com">
  <input type="text" value="some text">
  <input type="submit" value="Send">
</form>
<script>
$( "#id-form" ).submit(function( event ) {
  alert( "Handler for .submit() called" );
});
</script>
</body>
</html>

 



answered Aug 22, 2016 by avibootz
...