Li value attribute
Definition and Usage
value
Set or return the value of the list item's value attribute.
<li> value attribute Set the value of the list item, which must be a number and can only be used in ordered lists (<ol>).
See also:
HTML Reference Manual:HTML <li> Tag
Instance
Example 1
Set the list item to start incrementing from the number "7":
document.getElementById("myLi").value = "7";
Example 2
Return the value of the list item:
var x = document.getElementById("myLi").value;
Grammar
Return value attribute:
liObject.value
Set value attribute:
liObject.value = number
Attribute Value
Value | Description |
---|---|
number | Specifies the value of the list item. |
Technical Details
Return Value: | Number, representing the value of the list item. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <li> value Attribute