Reputation: 279
For example, to select all cells of a table
which contain only elements matching a selector selector
, I tried:
$('table tr td:has(' + selector + ')')
but this also matches cells also containing other stuff.
Then I tried:
$('table tr td:has(' + selector + '):not(:has(:not(' + selector + ')))')
But this always returns an empty object.
What am I doing wrong?
EDIT: Thanks guys, actually I was doing something wrong it seems, because trying with a minimal fiddle, it does seem to work using the second approach: http://jsfiddle.net/u0r6oehc/1/
Upvotes: 0
Views: 48