Latest web development tutorials

HTML DOM Li value property

Li Object Reference Li Objects

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


Li Object Reference Li Objects