<html>
<body>
<ol id="myOl">
<li>咖啡</li>
<li>绿茶</li>
<li>牛奶</li>
<li>果汁</li>
<li>纯水</li>
</ol>
<p>单击该按钮可查看列表顺序是否是降序。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myOl").reversed;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>