HTML | <li> value Attribute
The <li> value attribute in HTML is used to specify the initial value of the list item. It is only applicable on the ordered list.
Syntax:
<li value="number">list items </li>
Attribute Value: This attribute contains single value number which is used to specify the value of the list items.
Example 1: This example uses <li> value attribute to create list of items.
<!DOCTYPE html> <html> <head> <title> HTML list item value Attribute </title> </head> <body> <center> <h1 style = "color: green;"> GeeksforGeeks </h1> <h2> HTML list item value Attribute </h2> <p>Sorting Algorithms</p> </center> <ol style="margin-left:42%"> <li value="50">Merge sort</li> <li>Quick sort</li> <li>Insertion sort</li> </ol> </body> </html> |
Output:

Example 2: This example uses <li> value attribute to create list of items.
<!DOCTYPE html> <html> <head> <title> HTML li value Attribute </title> </head> <body> <h1 style = "color: green;"> GeeksforGeeks </h1> <h2> HTML li value Attribute </h2> <p>Sorting Algorithms</p> <ol type = "A"> <li value="6">Merge sort</li> <li>Quick sort</li> <li>Insertion sort</li> </ol> </body> </html> |
Output:

Supported Browsers: The browser supported by <li> value attribute are listed below:
- Apple Safari
- Google Chrome
- Firefox
- Opera
- Internet Explorer
Recommended Posts:
- HTML | <map> name Attribute
- HTML | low Attribute
- HTML | <a> rel Attribute
- HTML | value Attribute
- HTML | dir Attribute
- HTML | <img> alt Attribute
- HTML | for Attribute
- HTML | min Attribute
- HTML | <img> src Attribute
- HTML | autocomplete Attribute
- HTML <button> value Attribute
- HTML | form Attribute
- HTML | target Attribute
- HTML | <td> width Attribute
- HTML | <td> height Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



