- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML reversed Attribute
The reversed attribute of the <ol> element in HTML is used to set reversed ordering of list items in an ordered list. It displays the numbering in descending order and introduced in HTML5.
Following is the syntax −
<ol reversed>
Let us now see an example to implement the reversed attribute of the <ol> element −
Example
<!DOCTYPE html> <html> <body> <h2>Rank in Descending order</h2> <ol reversed> <li>Tom</li> <li>Jack</li> <li>Will</li> <li>Harry</li> <li>Tim</li> <li>Steve</li> <li>David</li> <li>Kane</li> <li>William</li> <li>John</li> </ol> </body> </html>
Output
In the above example, we have set an unordered list with the following list items under <li> −
<li>Tom</li> <li>Jack</li> <li>Will</li> <li>Harry</li> <li>Tim</li> <li>Steve</li> <li>David</li> <li>Kane</li> <li>William</li> <li>John</li>
The above goes under the <ol> element for an unordered list. To apply for reversed order, use the reversed attribute −
<ol reversed> <li>Tom</li> <li>Jack</li> <li>Will</li> <li>Harry</li> <li>Tim</li> <li>Steve</li> <li>David</li> <li>Kane</li> <li>William</li> <li>John</li> </ol>
Advertisements