select,radio,checkbox用attr设置选中只有第一次有效

用prop代替attr就可以了

$("input").attr("checked",true);
//改成下面这种
$("input").prop("checked",true);

猜你喜欢

转载自blog.csdn.net/weixin_39752673/article/details/81145317