Hi,
I have a table containing radiobuttons (i.e. 3x3 grid) and I want when I select one of them the containing the radiobutton to change colour. Following this example I did this
<table class="table-name">
<tr>
<td>
<span>Some text</span>
<input type="radio" name="some-name" />
</td>
<td>
<span>Some text</span>
<input type="radio" name="some-name" />
</td></tr>
</table>
and the javascript
$(':radio').change(function() {
$('.color-1').removeClass('color-1');
var $td = $(this).parent('td');
if (this.checked) {
$td.addClass('color-1');
} else {
$td.removeClass('color-1');
}
});
this works well on firefox. but on internet explorer it colors the previously selected So if I select 1,1 it stays white but when I select 1,2 then 1,1 turns blue and so on.
Any ideas?