Form submit() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form


The submit() method submits the form.

The following code shows how to Submit a form:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<form id="myForm" action="#">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br><br>
  <input type="button" onclick="myFunction()" value="Submit form">
</form>//  ww  w . j  a  va  2s . c  o  m

function myFunction() {


Related Tutorials