Ol reversed Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Ol


The reversed property sets or gets whether the list order should be descending.

Set the reversed property with the following Values

Value Description
true|false Sets whether the list order should be descending

Return Value

A Boolean, returns true if the list order is descending, otherwise it returns false

The following code shows how to Set the list order to descending:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<ol id="myOl">
</ol>/*w w  w.  j a  v a  2  s  . c  o m*/

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {
    var x = document.getElementById("myOl").reversed;
    document.getElementById("demo").innerHTML = x;


Related Tutorials