value attribute (li)
Specifies the number of a list item.
- In an ordered list, a number is displayed before every list item.
- In an unordered list, the number has no visual effect.
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.
Default:
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:
|
||||
<ol> <li value="2">first item <li>second item <li value="15">Third item </ol> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
External links:
User Contributed Comments