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 |
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:
<!DOCTYPE html> <html> <body> <ol id="myOl"> <li>A</li> <li>B</li> <li>C</li> <li>D</li> <li>E</li> </ol>/*w w w. j a v a 2 s . c o m*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myOl").reversed; document.getElementById("demo").innerHTML = x; } </script> </body> </html>