Easy Tutorial
❮ Prop Element Offsettop Dom Htmlcollection ❯

Button value Attribute


Definition and Usage

The value attribute sets or returns the value of the value attribute of a button.

The value attribute specifies the text displayed on the button.

Important: If you use the button element in an HTML form, different browsers will display different values. Internet Explorer displays the value between the <button> and </button> tags, while other browsers display the value of the value attribute. In HTML forms, you can use the input element to display a button.

Syntax


Browser Support

All major browsers support the value attribute.


Example

Example

Return the text displayed on the button:


❮ Prop Element Offsettop Dom Htmlcollection ❯