Ol reversed Property - Find out if the list order is descending or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Ol

Description

Ol reversed Property - Find out if the list order is descending or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<ol id="myOl">
  <li>A</li>
  <li>B</li>
  <li>C</li>
</ol>//w  w  w .j a v a 2 s. co 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>

Related Tutorials