案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何访问 OL 元素</h3>
6
7
<ol id="myOl">
8
  <li>Coffee</li>
9
  <li>Tea</li>
10
  <li>Milk</li>
11
</ol>
12
13
<p>点击按钮来设置列表项的数字从 25 开始递增。</p>
14
15
<button onclick="myFunction()">试一下</button>
16
17
<script>
18
function myFunction()
19
{
20
var x = document.getElementById("myOl");
21
x.start = "25";
22
}
23
</script>
24
25
</body>
26
</html>
27