使用attr添加 selected 和 checked 属性 在某个项目中,要根据每个item的不同的条件对radio的checked进行赋值, $(“input[name=’ ']”).attr(“checked”,true); 多次赋值,会发现attr不起作用的情况。 于是将attr改成prop: $(“input[name=’ ']”).prop(“checked”,true); selected标签同上,用prop代替即可