[thelist] DOM list elements only within another element

alex beston alex at deltatraffic.co.uk
Fri Jul 2 09:33:58 CDT 2004


isnt it just navcontainer a ?

<behaviour>

alex

>
> _I want to apply some behaviors to one set of elements within my page 
> but not any others. As an example imagine the following;
>
> <div id="navcontainer">
> <ul>
> <li><a href="">home</a></li>
> <li><a href="">products</a></li>
> <li><a href="">help</a></li>
> </ul>
> </div>
> <div id="content">
> <h1>Fruit</h1>
> <ul>
> <li><a href="">Apple</a></li>
> <li><a href="">Orange</a></li>
> <li><a href="">Pear</a></li>
> </div>
>
> Now I would like to add a behaviour to all the <a href=""> in the top 
> "navcontainer" div but not the "content" div. Is there an easy way to 
> do this? Or will I have to get all <a> elements then check they are in 
> an <li> block then check that that <li> is in the required div?
>
>  




More information about the thelist mailing list