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?

Reply via email to