Reputation: 81
I think, I make a simple mistake here:
$('.myRadioButtons').val('3121').attr("checked",true);
But this one does not work too:
$(':input[value="3121"]').attr("checked",true);
The same problem also with "prop" instead of "attr".
Thank you..
EDIT: Here is online: http://jsfiddle.net/WWC4G/1/
Upvotes: 3
Views: 5968
Reputation: 22619
Try using below
$('input[value="3121"]').prop("checked",true)
or
$('input[value="3121"]').attr("checked","checked")
Upvotes: 6