W3cubDocs

/Web APIs

HTMLLIElement: value property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

The value property of the HTMLLIElement interface indicates the ordinal position of the list element inside a given <ol>. It can be smaller than 0. If the <li> element is not a child of an <ol> element, the property has no meaning.

It reflects the value attribute of the corresponding <li> element. If the <li> element does not have a value content attribute specified, then this property returns 0 by default even when the element may have a default serially-assigned ordinal value when rendered.

Value

An integer.

Specifications

Specification
HTML>
# dom-li-value>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
value 1 12 1 ≤12.1 1 18 4 ≤12.1 1 1.0 4.4 1

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLLIElement/value