Skip to content Skip to sidebar Skip to footer

Jquery To Highlight Table Row On Radio Select

I have a table (standard markup) with a radio select in each row. Once the radio is selected I'd like to highlight that . Sounds straight forward enough but I can't get it to tri

Solution 1:

The radio's parent isn't actually the table row, it's the label. use the .closest method instead to look up the parent chain until you get to the TR.

$(this).closest('tr').addClass('hilite');

Solution 2:

Not the cleanest way probably, but what if you use $(this).parent().parent().addClass('.hilite'); ?

Post a Comment for "Jquery To Highlight Table Row On Radio Select"