Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Ol reversed Property

Ol reversed Property

Ol Object Reference Ol Object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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.
  • 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: 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 Reference Ol Object