checkbox 全選/全部取消
$("#ChkAll").click(function(){
$("#divContent input[type='checkbox']").attr("checked",$(this).attr("checked"));
});
獲取選中的checkbox的value值:
var arrChk=$("input[name='chk_list'][checked]");
$(arrChk).each(function(){
window.alert(this.value);
});
});
$("#checkbox_id").attr("checked"); //獲取一個(gè)CheckBox的狀態(tài)(有沒有被選中,返回true/false)
$("#checkbox_id").attr("checked",true); //設(shè)置一個(gè)CheckBox的狀態(tài)為選中(checked=true)
新聞熱點(diǎn)
疑難解答