Are there any major differences between <button type="button" name="theButton">SUBMIT</button>
and <input type="submit" value="SUBMIT" name="theButton" />
Also, can you use <button type="submit" name="theButton">SUBMIT</button>
?
The difference is that <button> can have content, whereas <input> cannot (it is a null element). While the button-text of an <input> can be specified, you cannot add markup to the text or insert a picture.
A 'button' is just that, a button, to which you can add additional functionality using Javascript. A 'submit' input type has the default functionality of submitting the form it's placed in (though, of course, you can still add additional functionality using Javascript).
Submit button is added for a form. When submit is clicked it triggers to the address written in the "action" attribute of form element. Button can be used anywhere as a general purpose. It can be used to redirect to any link and not restricted to a form action.
You use css and style a link <a> to look like a button.
Here's a page describing the differences (basically you can put html into a <button></button>
And an other page describing why people avoid <button></button>
(Hint: IE6)
Reference: <button> vs. <input type="button" />. Which to use?
Also have a look at this slideshow about button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With