When we add a <button>
element
with the type attribute set as submit
,
it will be responsible for submitting
the data entered in the form by the user.
If the type attribute is not added
to a <button>
element,
its default type will be submit
.
However, if the button is placed
outside a <form>
element,
specifying type="submit"
would
have no effect as there is no associated
form to submit.
In this scenario, the button would behave
like a regular button without any default
action triggered by pressing it.
Let us take a look at the example: