Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Button value Property

Button value Property

Button Object Reference Button Object


Definition and Usage

The value property sets or returns the value of the value attribute on the 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 in the tag, while other elements display the value of the value attribute. In an HTML form you can use the input element to display a button.

Syntax

buttonObject.value=

value


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value property.


Example

Example

Return the text displayed on the button:

Runoob Tutorial(runoob.com)

The text of the button:

Try it »


Button Object Reference Button Object