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

HTMLWeb DevelopmentFront End Technology

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>
raja
Updated on 24-Jun-2020 11:47:17

Advertisements