I want to change the background color of the table cell when radio button inside the cell is clicked.
<table>
<tr>
<td align="center">
<input type="radio" value="foo"
onclick="this.parentElement.style.background-color='red';" />
</td>
</tr>
</table>
How to get the parent element reference?
parentElementis a weird and totally pointless IE-only property. The spelling you are looking for isparentNode.h:selectOneRadiocould quite easily get converted to some nested HTML tags and selecting the immediate parent wouldn't work.