Add class active to the <li> tag
<p>I want to add class active to the <code>&lt;li&gt;</code> whenever specific url is accessed?</p>

<p>my code look like this,</p>

<pre><code>&lt;ul&gt;
&lt;li&gt;
    &lt;a href="link1"&gt;Link1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
    &lt;a href="link2"&gt;Link2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
    &lt;a href="link3"&gt;Link3&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
    &lt;a href="link4"&gt;Link4&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
    &lt;a href="link5"&gt;Link5&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
    &lt;a href="link6"&gt;Link6&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>if www.abc/link1 is is present in the url then only 1st li should be active and rest of them should not have any class.</p>

<p>Thnks in advance</p>
