Tag <button> HTML Reference

CSS Reference (New)


Example

A button is marked up as follows:

<button type="button">Click Me!</button>

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

1. Definition and Usage

The <button> tag defines a push button.

Inside a <button> element you can put content, like text or images. This is the difference between this element and buttons created with the <input> element.

Tip: Always specify the type attribute for a <button> element. Different browsers may use different default types for the <button> element.


2. Tips and Notes

Important: If you use the <button> element in an HTML form, different browsers may submit different values. Internet Explorer, prior version 9, will submit the text between the <button> and </button> tags, while other browsers will submit the content of the value attribute. Use the <input> element to create buttons in an HTML form.


3. Differences Between HTML 4.01 and HTML5

HTML5 has the following new attributes: autofocus, form, formaction, formenctype, formmethod, formnovalidate, and formtarget.


4. Optional Attributes

DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

Attribute Value Description DTD
disabled disabled Specifies that a button should be disabled STF
name name Specifies the name for a button STF
type button
reset
submit 
Specifies the type of button STF
value text Specifies the initial value for a button STF

5. Standard Attributes

The <button> tag supports the Standard Attributes in HTML.


6. Event Attributes

The <button> tag also supports the Standard Event Attributes in HTML.


Relative articles

Learning Foreign Words
Learning Foreign Words

Learning Foreign Words

Do you think that learning new foreign words is tedious? Each of us could face with learning of new languages. Sure, it can be tiresome especially if you try to remember a plenty of new words at once. But what if to memorize words sequentially, one by one? I believe that this is one of good solutions. I prepared a simple but at the same time efficient script that will help you in learning new words. This script takes a list of new words, and turns it into a slider where you have to guess if you know the word or not. If you are uncertain of the word – press the button ‘I know’, otherwise – just skip the word. We also can finish the test or do hint.
(more…)


Creating new HTML5/CSS3 single page layout – Art theme
Art HTML5&CSS3 single page layout

Creating new HTML5&CSS3 single page layout – Art theme

Today I will like to product new great masterpiece – new template with codename: ‘Art theme’. This will nice HTML5 template with nice gray colors. Hope that you will like new styles and you will learn some new coding lessons.

I going to start step-by-step tutorial for creating html5-css3 layout.

(more…)