Editor Arrow Download Open
<!DOCTYPE html> <html> <head> <title>jQuery :parent Selector</title> <script src="jquery-latest.min.js"></script> <script> $(document).ready(function() { $("td:parent").css('background-color', 'red'); }); </script> </head> <body> <h1>Article heading</h1> <table border="1" width="300px;"> <tr> <td>A</td> <td>B</td> <td></td> </tr> <tr> <td>Z</td> <td></td> <td>Y</td> </tr> </table> </body> </html>
  Preview Arrow