I need to select radio buttons with similar unique_id when I select one of the existing radio buttons. Here is the code:
$('.test li input:radio').change(function () {
var unique_id = $(this).attr('unique_id');
$('input:radio').each(function () {
if ($(this).attr('unique_id') == unique_id) {
$(this).attr('checked', true);
} else {
$(this).attr('checked', false);
}
});
});
In google chrome it is working but not always. It may work and may not work. Try to select radios many times. In Mozilla it doesn't work at all. What am I to do?