HTML forms have several different ways to submit, as you've learned on the previous page. Two of those methods are the
INPUT tag and the
BUTTON tag. There are good reasons to use both of these elements.
<input type="submit"> tag is the easiest way to submit a form. It requires nothing beyond the tag itself, not even a
value. When a customer clicks on the button, it submits automatically. You don't need to add any scripts, the browsers know to submit the form when a submit
INPUT tag is clicked.
The problem is that this button is very ugly and plain. You can't add images to it. You can style it just like any other element, but it can still feel like an ugly button.
BUTTON element offers more options for submiting forms. You can put anything inside a
BUTTON element and turn it into a submit button. Most commonly people use images and text. But you could create a
DIV and make that entire thing a submit button if you wanted to.
The biggest drawback to the
BUTTON element is that it doesn't automatically submit the form. This means there needs to be some type of script to activate it. And so it is less accessible than the
BUTTON element to submit it.
BUTTON method on forms that are not as critical. Also, this is a great way to add additional submission options within one form.
This article is part of the HTML Forms Tutorial. Read it to learn more about how to use HTML forms.