HTMLFormElement.submit()
method submits a given <form>
.<button>
. When invoking this method directly, however:submit
event is raised. In particular, the form's onsubmit
event handler is not run.HTMLFormElement.requestSubmit()
method is identical to activating a form's submit <button>
and does not have these differences.name
or id
of submit
, this method will mask the form's submit method.<input>
with attribute type='submit' will not be submitted with the form when using HTMLFormElement.submit()
, but it would be submitted when you do it with original HTML form submit.Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'HTMLFormElement: submit' in that specification. | Living Standard |