Ol reversedProperty

Ol 对象参考手册Ol Object

Example

Set the list to descending order:

document.getElementById("myOl").reversed=true;

Try it Yourself »

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Except for Internet Explorer, all major browsers 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

Property Values

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

Technical Details

Return Value: A Boolean value, returning true if the list is in descending order, otherwise returning false.


More Examples

Example

Detect whether the list is in descending order:

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

xThe output result is:

false

Try it Yourself »


Related Articles

HTML Reference Manual:HTML <ol> reversed Attribute


Ol 对象参考手册Ol Object

Other Extensions