Easy Tutorial
❮ Met Loc Replace Prop Label Htmlfor ❯

HTML DOM value Property

Attributes Object

Example

Return the attribute value:

Output result:

Set the attribute value

Example

Set the style attribute of the header element:

Style attribute before modification:

Hello World

Style attribute after modification:

Hello World


Definition and Usage

The value property is used to set or return the value of an attribute.


Browser Support

All major browsers support the value property.


Syntax

Set the attribute value

Return the attribute value

Technical Details

Return Value: String, representing the value of the attribute.
DOM Version Core Level 1
--- ---
❮ Met Loc Replace Prop Label Htmlfor ❯