value attribute | value property
Sets or retrieves the value of a list item.
Syntax
| HTML | <element value="p" ... > |
|---|---|
| JavaScript | |
Property values
Type: Integer
the value of the item.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
- HTML 4.01 Specification, Section 10.2 (Deprecated)
Remarks
In an ordered list, the value is the number that precedes the list item. Changing the value will change the visual numbering of all following list items. In an unordered list, the value is initially zero. Changing the value has no visual effect on the item.
Examples
This example sets each line item's value to an integer string.
<ol> <li value="1">One</li> <li value="2">Two</li> <li value="3">Three</li> </ol>
See also
Show: