JQuery/CSS require multiple classes
Is it possible in jQuery or CSS (since I think they use the same selector logic) to say select elements that have multiple classes. For example:
<div class='class1'></div&开发者_Python百科gt;
<div class='class2'></div>
<div class='class1 class2'></div>
Is there a way I can say I want elements that are of both class1 and class2 (therefore only get the third div in this case)?
The selector you are looking for is .class1.class2
For more info, check out the spec: http://www.w3.org/TR/CSS2/selector.html#class-html
精彩评论