Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any drawbacks to using <button> instead of <input type="submit"> if I'm not supporting IE6/7?

The reason for my question is I'd like to use a search icon from an icon font, which I can't think of a good way to do with an input. I know IE6 and maybe 7 had some quirks with buttons, but if I'm not supporting those, are there any drawbacks to just using a <button> tag?

With a <button> tag I can just use the required html inside the tag.

like image 380
GusRuss89 Avatar asked Nov 19 '25 21:11

GusRuss89


1 Answers

The button element represents a button labeled by its contents.

A <button> can contain phrasing content (except for other interactive content such as <input>).

In my experience there's no problem using a <button> instead of an <input type=button>. IE7- will submit the <button>'s contents, which is odd. That's pretty much all you have to worry about, though.

like image 112
Explosion Pills Avatar answered Nov 21 '25 10:11

Explosion Pills