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

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -