jQuery set a radio input

I finally found the answer here:
https://stackoverflow.com/questions/9525128/jquery-set-radio-button
https://web.archive.org/web/20160421163524/http://vijayt.com/Post/Set-RadioButton-value-using-jQuery

Basically, if you want to check one radio button, you MUST pass the value as an array:

$('input:radio[name=cols]').val(['4']);
$('input:radio[name=rows]').val(['3']);

So no more of these pre/post v1.6 versions:

$("#radio_1").prop("checked", true);
$("#radio_1").attr('checked', 'checked');
$("input[name=background][value='some value']").prop("checked",true);
$("#radio_1").prop("checked", true).change();
$(this).attr({"checked":true}).prop({"checked":true});
$("[name='type']").click(function(){
  $("[name='type']").removeAttr("checked");
  $(this).attr({"checked":true}).prop({"checked":true});
});
// JQueryUI
$("#option2").prop("checked", true); // Check id option2
$("input[name='radio_options']").button("refresh"); // Refresh button set

Have a nice day!