Find if id of a link equals id of parent container
- by Robert Lawson
Hi guys needing a bit of help.
I am creating a one page personal site.
Each section has a menu in it to jump to another section, however i want to have a class added to menu for the current section:
i.e. if you are in about the about link would have a class 'current'.
This is how it looks.
<section id="about">
<nav>
<li><a href="#" id ="about">About</a></li>
<li><a href="#" id ="contact">About</a></li>
<li><a href="#" id ="blog">About</a></li>
</nav>
New to jquery so i am struggling to find out how to do this.
Any help will be greatly appreciated.
Thanks