Computer >> Computer tutorials >  >> Programming >> HTML

How do we specify that the list order should be descending (9,8,7, 6, 5...) in HTML?


Use the reversed attribute in HTML to specify that the list order should be descending.

Example

You can try to run the following code to implement reversed attribute −

<!DOCTYPE html>
<html>
   <body>
   <h3>Cricketers List</h3>
      <ol reversed>
         <li>Amit</li>
         <li>Amal</li>
         <li>Rahul</li>
         <li>Virat</li>
      </ol>
   </body>
</html>