It will be a difficult situation when I want to add a class to all the parent <tr> of <td> that have a <span> or <div> element in them. Therefore, I have a table with markup, as shown below:
<table> <tr> <td> </td> <td> </td> <td> <div> </div> </td> <td> </td> </tr> <tr> <td> <span></span> </td> <td> </td> <td> <div> </div> </td> <td> </td> </tr> </table>
So, I want <td> have either <span> or <div> to add a class to them using jQuery ...
I cannot figure out how to skip all the <td> tags to check their descendants, and then add a class to those that have either <span> or <div> inside ... Is this possible?
Thanks for any light you can shed on it! It drives me crazy!
dubbs source share