jquery怎么让checkbox不选中?

jquery让checkbox不选中的方法:

1、使用prop()方法

//设置不选中:
$("input[type='checkbox']").prop("checked",false);
//设置选中:
$("input[type='checkbox']").prop("checked",true);

2、使用attr()方法

//设置不选中:
$("input[type='checkbox']").attr("checked",false);
//设置选中:
$("input[type='checkbox']").attr("checked",true);
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容