(General question was indeed already asked, but the answer given here gives a nice way to solve the problem posed here, instead of the other question's 'behind the scenes' explanation...)
I'm trying to highlight all the cells in a table (with embedded tables) that contains an input field.
Sample code: jsFiddle
I can do it with $('#rec td:has(>input)')
but I would prefer to use the .has() method as the doc for the :has() selector mentions performance issues - my table can become quite big with several embedded tables and I - still - have to support IE6...
However, $('#rec td').has('>input')
does not work (it includes cells which does not actually have an <input>
as a direct child), seemingly ignoring the >
child selector...
Is there a way to get the same result with the .has() method as with the :has() selector?