THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Ol reversed Property

Ol Object Reference Ol Object

Example

Set the list order to descending:

document.getElementById("myOl").reversed = true;
Try it Yourself »

Definition and Usage

The reversed property sets or returns whether the list order should be descending or not.

When set to true, the list order will be descending (9, 8, 7...), instead of ascending (1, 2 , 3...).


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The reversed property is supported in all major browsers, except Internet Explorer.

Note: The reversed property is not supported in Safari 5 and earlier versions.


Syntax

Return the reversed property:

olObject.reversed

Set the reversed property:

olObject.reversed=true|false

Property Values

Value Description
true|false Specifies whether the list order should be descending or not
  • true - The list order is descending
  • false - Default. The list order is not descending (it is ascending)

Technical Details

Return Value: A Boolean, returns true if the list order is descending, otherwise it returns false

More Examples

Example

Find out if the list order is descending or not:

var x = document.getElementById("myOl").reversed;

The result of x will be:

false
Try it Yourself »

Related Pages

HTML reference: HTML <ol> reversed attribute


Ol Object Reference Ol Object