HTML <li> valueAttribute

HTML li 标签参考手册HTML <li> Tag

Examples

Use the value attribute in an ordered list:

<ol>
  <li value="100">Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
  <li>Water</li>
  <li>Juice</li>
  <li>Beer</li>
</ol>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value attribute.


Definition and Usage

The value attribute sets the value of a list item. The following list items will increment from that number.

The value must be a number and can only be used in ordered lists (<ol>).


Differences Between HTML 4.01 and HTML5

In HTML 5, the value attribute of the <li> element is not deprecated.


Syntax

<li value="number">

Attribute Values

Value Description
number Specifies the value of a list item.


HTML li 标签参考手册HTML <li> Tag Other Extensions