so I have,
<ul>
<li class="foo">
abc
</li>
<li class="foo bar">
def
</li>
</ul>
If I do $('.foo').css('font-size','x-large');
this will change both li elements with the large font. How could I select the class with “foo” only but not “bar”?
Thanks!
You can use the following attribute selector, I suppose:
Here’s a JSFiddle to play with. )