<font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
><div id =“contentarea”></font></font><font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
<p>一些<span>文字</ span> </ p></font></font><font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
<b>粗體文字</ b></font></font><font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
</ DIV></font></font><font></font>
<font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
<script type =“text / javascript”></font></font><font></font>
<font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
var
rootnode = document.getElementById(“contentarea”)</font></font><font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
var
walker = document.createTreeWalker(rootnode,NodeFilter.SHOW_ELEMENT,
null
,
false
)</font></font><font></font>
<font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
alert(walker.currentNode.tagName)
<font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
while
(walker.nextNode())</font></font><font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
alert(walker.currentNode.tagName)
<font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
walker.currentNode = rootnode
alert(walker.firstChild()。tagName)
<font></font><font style=
"vertical-align: inherit;"
><font style=
"vertical-align: inherit;"
>
</ SCRIPT></font></font>