Link to home
Start Free TrialLog in
Avatar of stargateatlantis
stargateatlantis

asked on

jquery targeting parent to add class

I have the following code here Trying to figure out how to add a class named active to the list tag.  

<ul id='sub-nav'>
<li><a href='#one'>Item One</a></li>
<li><a href='#two'>Item Two</a></li>
<li><a href='#three'>Item Three</a></li>
<li><a href='#four'>Item Four</a></li>
</ul>

 $("#sub-nav a[href='#one'']").click(function(){
    /*Trying to figure out how to add a class named active to the list tag */
})

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe 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