$(“input”).prop(“disabled”,true);
$(“input”).prop(“checked”,true);//选中
$(“input[type=checkbox]”).removeAttr(“checked”);//取消选中
$(“input[type=‘checkbox’]”).is(’:checked’);//是否选中
$(“input”).is(’:checked’);//是否选中
博客展示了使用jQuery对input元素状态进行操作的代码,包括设置禁用、选中、取消选中以及判断是否选中状态等内容,这些操作在前端开发中较为常用。
$(“input”).prop(“disabled”,true);
$(“input”).prop(“checked”,true);//选中
$(“input[type=checkbox]”).removeAttr(“checked”);//取消选中
$(“input[type=‘checkbox’]”).is(’:checked’);//是否选中
$(“input”).is(’:checked’);//是否选中
1020
2689

被折叠的 条评论
为什么被折叠?