JS中对DOM元素的操作
https://www.runoob.com/jquery/jquery-ref-html.html
1.each 遍历
//遍历所有class为checksingle的DOM元素 $(".checksingle").each(function () { count += 1; });
2.is() 判断
$(".checksingle").each(function () {
if ($(this).is(":checked")) { //遍历的当前复选框为选中状态时
flag += 1;
}
});
3.attr("属性名",value) ---添加属性
$('#Confirm').attr("disabled", false) //disable=false 设置DOM为不可用状态
$('#Confirm').attr("disabled", "disabled")
4.prop("属性名",value) ---添加属性
$(".checksingle").prop("checked", true);

浙公网安备 33010602011771号