Li value property
Example
Set the list item to increment starting from the number "200":
document.getElementById("myLi").value="200";
Try it »
Definition and Usage
The value property sets or returns the value of the value attribute of a list item.
The value property sets the value of a list item, and subsequent list items will increment starting from that number.
Note: The value must be a number and can only be used in an ordered list (
-
).
- value attribute
Browser support





All major browsers support the value attribute.
Syntax
Return the value attribute:
liObject
.value
Set the value attribute:
liObject
.value=
number
Attribute values
| Value | Description |
|---|---|
| number | Specifies the value of the list item. |
Technical Details
| Return Value: | Number, representing the value of the list item. |
|---|
More examples
Example
Return the value of a list item:
var x = document.getElementById("myLi").value;
x The output is:
100
Try it »
Related Articles
HTML Reference Manual:HTML
Li Object