Reputation: 1877
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!
Upvotes: 1
Views: 2115
Reputation: 6389
This should work:
$('.foo:first').css('font-size','x-large');
Upvotes: 0