TheJoshMan
01-07-2009, 08:51 AM
I was wondering if this is possible with js?
Say you've got several nested <ul> elements, and you'd like to use a small bit of js to assign the "parent" <li>'s a special classname...
<ul>
<li>Child</li>
<li>Child</li>
<li>Parent
<ul>
<li>Grandchild</li>
<li>Grandchild</li>
</ul>
</li>
<li>Child</li>
</ul>
So how could you go about getting js to autmatically assign the special classname to the "Parent" <li> shown above?
Say you've got several nested <ul> elements, and you'd like to use a small bit of js to assign the "parent" <li>'s a special classname...
<ul>
<li>Child</li>
<li>Child</li>
<li>Parent
<ul>
<li>Grandchild</li>
<li>Grandchild</li>
</ul>
</li>
<li>Child</li>
</ul>
So how could you go about getting js to autmatically assign the special classname to the "Parent" <li> shown above?