- HTML DOM 可以可以对HTML中的元素进行删除,增加的操作,要操作HTML DOM可以使用JavaScript的语言对HTML DOM进行访问.
- 原html文件
<html>
<head>
<title>欢迎页面!</title>
<meta charset="utf-8"/>
</head>
<body>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<span>Hello World!</span>
<div>
<span id="10">Hello World!</span>
</div>
</body>
</html>
- 使用getElementsByTagName()方法取得所有span元素,
<scrip