HTML DOM Li value property
Examples
Setting item from the list of the number "200" increments:
document.getElementById("myLi").value="200";
try it"
Definition and Usage
value property sets or returns a value of the attribute value list item.
value property is set to a value of the item list, a list of items from the follow-up of digital increments.
Note: The value must be a number, and can only be used in an ordered list (<ol>) in.
Browser Support
All major browsers support attribute value.
grammar
Returns the value property:
liObject .value
Set the value property:
liObject .value= number
Property Value
值 | 描述 |
---|---|
number | 指定列表项的值。 |
technical details
return value: | Number that represents the value of the list item. |
---|
More examples
Examples
Returns a list item:
var x = document.getElementById("myLi").value;
x The output is:
100
try it"
related articles
HTML Reference Manual: HTML <li> value The property