html - How to use jQuery .has() within a nested table -




i'm trying color td cell has nested table class "red". jquery code i'm using color top table, not parent td cell. how need modify following code.

and little reference, i'm using sharepoint nests tables within table within tables. don't have control on unfortunately.

thanks

$("td:has(.red)").addclass("redbg"); 

i go reverse order: find table class red, add class redbg closest td cell:

$('table.red').closest('td').addclass('redbg'); 

this rather solution, not answer question.

for jquery closest method have:

for each element in set, first element matches selector testing element , traversing through ancestors in dom tree.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -