You are here: Reference > HTML > attributes > value (li)

value attribute (li)

Browser support:
Specifies the number of a list item.
If you want to change the visual appearance of the counter displayed before all list items, use the list-style-type style property.
JavaScript page for this attribute: value. You can find other example(s) there.

Possible values:

String that sets the number shown as a counter before the element. Only positive integers are allowed in Internet Explorer, Google Chrome and Safari. Negative integers are not allowed in Firefox. Opera supports both negative and positive integers.
Element Default value
ordered list 1 for the first list item and the number of the previous list item increased by one for other list items.
unordered list 0 in Internet Explorer, -1 in Firefox, Opera, Google Chrome and Safari.

Example HTML code 1:

This example illustrates the use of the value attribute:
    <li value="2">first item
    <li>second item
    <li value="15">Third item
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content