Changing cell class on radio button change
- by Nick
Huge thanks for the help in this thread - Click td, select radio button in jQuery
But now I'm having trouble that it won't change the class of the cell, even though I have binded the 'change' trigger in jQuery like so:
$("td input[type=radio]").bind('change click', function () {
$('td').removeClass('selected');
$(this).parent('td').addClass('selected');
});
$("td").click(function () {
$('input:radio', this).attr('checked', true);
});
Hope that makes sense. If you click the radio button, or move between them using the keyboard, the cell's class changes just fine. However if you trigger this by clicking the cell it doesn't change the class :(
Thanks