Tuesday, May 8, 2012

tree for ChilNode of childNode in javascript

i have this simple html:



<div id="tree">
<div class="roi">
<ul>
<li>text1</li>
<li>text2</li>
<li>text3
<ul>
<li>insideText1<li>
<li>insideText2<li>
</ul>
</li>
</ul>
</div>
</div>


i want to get only the item "text2" and the item "insideText2";
so i tried to wrote:



var Tree=document.getElementById("tree").document.getElementsByTagName("UL");



But i do'not know how to rich the specific li that conatins :"text2" and "insideText2".
Please help.
Thanks.





No comments:

Post a Comment