Alex Rivera | Logout

input type="submit" Vs button tag are they interchangeable?

Asked 2011-08-19T06:13:19.067
348

input type="submit" and button tag are they interchangeable? or if there is any difference then When to use input type="submit" and when button ?

And if there is no difference then why we have 2 tags for same purpose?

Edit
Report

1 Answer

191

http://www.w3.org/TR/html4/interact/forms.html#h-17.5

Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For example, a BUTTON element that contains an image functions like and may resemble an INPUT element whose type is set to "image", but the BUTTON element type allows content.

So for functionality only they're interchangeable!

(Note, type="submit" is the default for button)

answered 2011-08-19T06:16:10.820

Your Answer