li (List) Element
<li> (List Element)
Explanation
LI Element is used to create list items in a HTML document.
<ol>
<li>Text</li>
</ol>
<ul>
<li>Text</li>
</ul>
Element Specific attributes supported by this tag are:
Attribute | Value | Description |
value | number | Defines value of a list item. The value must be a number. It can be used only if the list is an ordered list. |
Example Code 1:
Result 1:
- Indigo
- Jet Airways
- Air India
Example Code 2:
Result 2:
- Indigo
- Jet Airways
- Air India
- Use this element to highlight and differentiate the list item from rest of the content.
- It is compulsory to place this element inside the <ul> or <ol>.
It is available in older versions of HTML5.
It supports both
Global Attributes and
Event Attributes in HTML5.
Limitations:
It will function in all the browsers.