Ol reversed attribute

Definition and usage

reversed Attribute setting or returning whether the list order should be in descending order.

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

See also:

HTML Reference Manual:HTML <ol> reversed Attribute

HTML Reference Manual:HTML <ol> Tag

Example

Example 1

Set the list order to descending order:

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

Try it yourself

Example 2

Check if the list order is in descending order:

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

Try it yourself

Syntax

Return the reversed attribute:

olObject.reversed

Set the reversed attribute:

olObject.reversed = true|false

Attribute value

Value Description
true|false

Is the order of the list should be in descending order?

  • true - The list order is descending
  • false - Default. The list order is not descending (ascending)

Technical Details

Return Value: Boolean value, returns true if the list order is descending; otherwise returns false.

Browser Support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Not Supported Support 6.0 Support