I have my markup something like this.
<div id="chromemenu" class="chromestyle">
<ul>
<li><a rel="dropmenu1" href="#" class="">Buy</a></li>
<li><a rel="dropmenu2" href="#" class="">Sell</a></li>
<li><a rel="dropmenu3" href="#" class="">Community</a></li>
<li><a rel="dropmenu6" href="#" class="">Languages</a></li>
<li><a rel="dropmenu4" href="#" class="">My Account</a></li>
</ul>
</div>
Now I have put jQuery to add a class inside a class selected. So when user hover on alink(here on Buy link) the markup becomes like this
<div id="chromemenu" class="chromestyle">
<ul>
<li><a rel="dropmenu1" href="#" class="selected">Buy</a></li>
<li><a rel="dropmenu2" href="#" class="">Sell</a></li>
<li><a rel="dropmenu3" href="#" class="">Community</a></li>
<li><a rel="dropmenu6" href="#" class="">Languages</a></li>
<li><a rel="dropmenu4" href="#" class="">My Account</a></li>
</ul>
</div>
Now I want to give style only the li whose a class is selected. My style for the li is to just give border to the li element. So can someone tell me how to do this? Any help and suggestions will be really appreciable. Thanks....
Update
I want to give border to my li element not the a so please help me in that field.Can this be achieved in simple css? Hey I am still for the answer...
selectedclass, why not just add the class to the parent of theathat's being hovered over. Then you can keep your hover style in your style sheet where it belongs and not in the javascript where it's hard to find.selectedclass on theliinstead of thea. Any other solution with applying CSS from jQuery will only lead to pain and suffering. (even though answers seem to lead you towards this...)