Ol reversed Property
Example
Set the list to descending order:
document.getElementById("myOl").reversed=true;
Try it »
Definition and Usage
The reversed property sets or returns whether the list is in descending order.
When set to true, the list is in descending order (9, 8, 7...), instead of ascending order (1, 2, 3...).
Browser support





All major browsers except Internet Explorer support the reversed property.
**Note:** Safari 5 and earlier versions do not support the reversed property.
Syntax
Return the reversed property:
olObject
.reversed
Set the reversed property:
olObject
.reversed=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Specifies whether the list is in descending order.
|
Technical Details
| Return Value: | A Boolean value: returns true if the list is in descending order, otherwise returns false. |
|---|
More examples
Example
Detect whether the list is in descending order:
var x = document.getElementById("myOl").reversed;
x The output is:
false
Try it »
Related Articles
HTML Reference Manual:HTML
-
reversed property
Ol Object