Jquery判断复选框checkbox是否被选中?(已解决)
<input type="checkbox" id="IfSave" name="fruit" value ="apple" > </input>alert($("#IfSave").val()); // 取value值
if ($("#IfSave").attr("checked") == true) {
alert("选中!");
}
else { alert("未被选中呀!"); }// 选择和取消代码
$("#IfSave:checkbox").attr('checked', 'true');
$("#IfSave:checkbox").attr('checked', 'flase');
本文介绍了使用JQuery判断复选框(checkbox)是否被选中的方法,包括获取复选框的状态并展示如何通过JQuery对其进行操作。
9747

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



