Links that have inner "active" links?

$("a:has(ul li a.active)").css("active");


i think that'll work if i understood you right

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'


                                                                       
  From:       iceangel89 <iceange...@gmail.com>                        
                                                                       
  To:         "jQuery (English)" <jquery-en@googlegroups.com>          
                                                                       
  Date:       07/24/2009 09:24 AM                                      
                                                                       
  Subject:    [jQuery] Re: Selector help needed                        
                                                                       






sorry the code is

<ul>
    <li><a href="#">Link 1</a></li>
    <li>
        <a href="#">Link 2</a>
        <ul>
            <li><a href="#" class="active">Link 2.1</a></li>
            <li><a href="#">Link 2.2</a></li>
        </ul>
    </li>
</ul>


On Jul 24, 9:20 pm, iceangel89 <iceange...@gmail.com> wrote:
> with the markup like:
>
> <pre>&lt;ul&gt;
>     &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 1&lt;/a&gt;&lt;/li&gt;
>     &lt;li&gt;
>         &lt;a href=&quot;#&quot;&gt;Link 2&lt;/a&gt;
>         &lt;ul&gt;
>             &lt;li&gt;&lt;a href=&quot;#&quot;
> class=&quot;active&quot;&gt;Link 2.1&lt;/a&gt;&lt;/li&gt;
>             &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link 2.2&lt;/
> a&gt;&lt;/li&gt;
>         &lt;/ul&gt;
>     &lt;/li&gt;
> &lt;/ul&gt;
> </pre>
>
> i want to add a class "active" to , Link 2 (line 4), or links that
> have inner a.active links. how can i do it with jquery or even pure
> css?

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

Reply via email to