jQuery - select multiple classes including object -
my html looks like:
<div class="class1 class2">text</div>
the related jquery select:
var obj$ = $('.class1');
how select .class2
part of object obj$
without repeating $('.class1.class2')
? far understand obj$.find('.class2')
should not work find()
not includes obj$
?
thanks.
you can use .filter()
subset of matched elements, e.g.
var $foo = $('.class1'); $foo.filter('.class2').css( 'color', 'blue' );
Comments
Post a Comment