Lists
HTML <li> element
Represents a list item in an ul, ol or menu. In an ordered list, value can set the item's ordinal number. A list item belongs to its parent list and may contain flow content, including nested lists. For ordered lists, its value can change the ordinal sequence from that item onward. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<li>Item</li>Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | element-dependent text or number | Sets an initial form value, a submitted option value, a list item ordinal or a numeric meter/progress value depending on the element. Current control state may differ from the content attribute. |
Return Value
HTMLLIElement
Content model: Flow content; parent is ol, ul or menu.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <ol> <li>Open the book</li> <li>Read a page</li> </ol> </body></html>