Use $('#myObject [class]:not([class=""])'). It will select all descendants of #myObject that have a class defined, and it will exclude elements that have had a class removed. (Thanks to @TravisJ for the not syntax!)