Reputation: 12695
I'm wondering how to remove the selected
class of the all a
element of the list ? I tried
$("#navigation li a").removeClass("selected");
but it seems not to be working.
$('#navigation li').hover(function () {
$(this).css('cursor', 'pointer');
}, function () {
$(this).css('cursor', 'auto');
});
<ul id="navigation">
<li class="home"><a class="selected"></a></li>
<li class="about"><a>text1</a></li>
<li class="services"><a>text2</a></li>
<li class="portfolio"><a>text3</a></li>
<li class="contact"><a>text4</a></li>
</ul>
Upvotes: 1
Views: 5723
Reputation: 3564
It seems to be working: http://jsfiddle.net/eG8ZS/
Maybe another part of script is not working?
Upvotes: 0
Reputation: 136074
Your code is removing the selected
class from the li
you hover over, rather than the a
within.
Upvotes: 0
Reputation: 94429
Make sure you have jquery setup correctly your example seems to be working. I setup a fiddle and it works fine: http://jsfiddle.net/kpDTV/
Upvotes: 3