SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: button tag
-
Jul 14, 2009, 17:26 #1
- Join Date
- Dec 2002
- Location
- Ann Arbor, MI (USA)
- Posts
- 648
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
button tag
I read somewhere recently that the button tag was improved and more semantically correct than input type="submit". I like that it's easy to specify a key/value pair separate from what's actually displayed on the button. However, I noticed on w3schools that in IE, the contents of the tag will be submitted, rather than the value attribute. Which should I use? Should I go back to my old name="action[value]" trick? IE:
HTML Code:<button type="submit" name="action" value="Save">Save Page</button>
HTML Code:<input type="submit" name="action[save]" value="Save Page" />
-
Jul 14, 2009, 20:59 #2
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<button> is not more semantically correct than <input>. They are equally semantic, just with slightly different purposes.
A <button> can have richer content – even block-level elements! – but it's not as well supported as <input>. Especially in IE.
Use <input type="submit"> when you can, and <button type="submit"> when you have to. That's my advice (which I live by, myself).Birnam wood is come to Dunsinane
-
Jul 14, 2009, 21:54 #3
- Join Date
- Jul 2008
- Location
- New York, NY
- Posts
- 1,432
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I agree with Tommy. I found a pretty neat presentation you might find of interest
http://nickcowie.com/presentation/s5-button.html
-
Sep 1, 2009, 07:27 #4
- Join Date
- Jul 2009
- Posts
- 111
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Use <input type="submit">, do not use <button>
Bookmarks