Link to home
Start Free TrialLog in
Avatar of movieprodw
movieprodw

asked on

use jquery to mark a link as active depending on the url

Hello,

I have:

<div class="col-left sidebar"><ul>
<li><a href="/installation" class="button-link">Installation</a></li>
<li><a href="/tuning" class="button-link">Tuning</a></li>
<li><a href="/101" class="button-link">101</a></li>
<li><a href="/about-us" class="button-link">About</a></li>
<li><a href="/tour-our-facility" class="button-link">Tour Our Facility</a></li>
<li><a href="/meet-the-team" class="button-link">Meet The Team</a></li>
<li><a href="/careers" class="button-link">Careers</a></li>
<li><a href="/contact" class="button-link">Contact Dyno-Comp</a></li>
</ul></div>

Open in new window


Is there a way to add the class 'active' if the url is the href with jquery?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of movieprodw
movieprodw

ASKER

Beautiful! Thank you
You are welcome.