Give the HTML button a little respect
Over at Digital Web Magazine, Aaron Gustafson has just published “Push my button“, a great article all about coding buttons, including very clever examples of what you can do with them.
If there’s one element I think doesn’t get enough respect, it’s gotta bebutton
. It’s played second fiddle toinput
in tutorials and form examples for as long as I can remember. The few times it actually did get some attention, the lowlybutton
was used and abused by the DHTML crowd—forced to accept obtrusive inline event handlers and other such nefarious crimes against semantic markup.
He continues with comparing the button
and input
elements.
Unlike theinput
-based buttons, the majority of browsers do not force any particular design on thebutton
element, leaving it a raw ingot which we can cast and shape to our liking. The image below depicts the submit-typebutton
as rendered by default in the more popular browsers.
This is a wonderful image of all the Submit buttons, an image I had thought of making before, but I thank Aaron for beating me to it.