i am not able to select the element with class of a particular value for the below line
My HTML is
<ul class=nav>
<li class="home">
<a href="">HOME </a>
</li>
<li class="bye">
<a href="">BYE </a>
</li>
</ul>
<script>
$("ul.nav li").click(function(e) {
$('.home').addClass('.newhome').removeClass('.home');
alert("done");
});
</script>
My CSS is
li.newhome {
background: #678fef no-repeat;
color:#fff;
}
li.home{
background: #666 no-repeat;
Here's a JSFiddle.
[]?<a>tags are useless if you don't put anything in. Unless you're going to put an background image as a link.