Latest web development tutorials

HTML DOM Ol reversed property

Ol Object Reference Ol objects

Examples

Set list is in descending order:

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

try it"

Definition and Usage

reversed property sets or returns whether the list in descending order.

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to Internet Explorer, the other major browsers support reversed attribute.

Note: Safari 5 and earlier versions do not support reversed attribute.


grammar

Back reversed attributes:

olObject .reversed

Setting reversed properties:

olObject .reversed=true|false

Property Value

描述
true|false 规定列表是否为降序。
  • true - 列表是降序的。
  • false - 默认。列表不是降序的(是升序的)。

technical details

return value: Boolean value that, if the list is in descending order, then returns true, otherwise returns false.


More examples

Examples

Detecting whether the list in descending order:

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

x The output is:

false

try it"


related articles

HTML Reference Manual: HTML <OL> the reversed attribute


Ol Object Reference Ol objects