The <button> Tag

As we described earlier, you create an action button with standard HTML or XHTML by including its type value in the standard <input> tag. For instance, the <input type=submit> form control creates a button that, when selected by the user, tells the browser to send the form’s contents to the processing server or to an email address (the mailto option). Display-wise, you don’t have any direct control over what that submit button looks like, beyond changing the default label “Submit” to some other word or short phrase (e.g., “Hit me” or “Outta here!”).

First introduced in the HTML 4.0 standard, the <button> tag acts the same as <input>, but it gives you more control over how the browser displays the element. In particular, all of the attributes you might use with the <input type=button> element are acceptable with the <button> tag.

The <button> Button

Neither the HTML 4 nor the XHTML standard is overly clear as to what display enhancements to a form the <button> element should provide, other than to suggest that the contents should be 3D and visually appear to react like a push button ...

Get HTML & XHTML: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.