You are here: Reference > HTML > tags > li

li element

Browser support:
Indicates a list item.
The li tag is used to insert a list item into an ordered (ol) or unordered (li) list.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
JavaScript page for this element: li.

Possible members:

Attributes
Events
Styles
Pseudos
accessKey
Sets an access key to an element.
class
Sets the style class or classes that belong to the element.
contentEditable
3
Sets whether the contents of the object are editable.
dir
Sets the text direction as related to the lang attribute.
DISABLED
Sets the state of an object for user interaction.
draggable
3.55
Sets whether an element is draggable.
HIDEFOCUS
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
language
Sets the scripting language for the current element. Use it only for the script element.
name
Sets the name of an element.
spellcheck
Sets whether the automatic spellchecker is enabled.
style
Sets an inline style associated with an element.
tabIndex
Specifies the tabbing order for keyboard navigation using the TAB key.
title
Specifies a tooltip for an element.
type
Specifies the numbering style of a list.
unSelectable
Sets whether the selection process can start in an element's content.
value
Specifies the number of a list item.
xml:lang
Sets the language code of the XML document.

Example HTML code 1:

This example illustrates the use of the li element for an ordered list:
<ol>
    <li>Apple</li>
    <li>Pear</li>
    <li>Peach</li>
</ol>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of ol and ul elements:
<ol style="list-style-type:upper-roman">
    <li>Menu 1
        <ol>
            <li>SubMenu 1_1</li>
            <li>SubMenu 1_2</li>
        </ol>
    </li>
    <li>Menu 2
        <ul style="list-style-type:decimal">
            <li>SubMenu 2_1</li>
            <li>SubMenu 2_2</li>
        </ul>
    </li>
    <li>Menu 3</li>
</ol>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content