Home >Web Front-end >JS Tutorial >Introduction to jquery traversing checkbox_jquery
checkbox Select all Cancel
$("#ChkAll").click(function(){
$("#divContent input[type=' checkbox']").attr("checked",$(this).attr("checked"));
});
Get the value of the selected checkbox:
var arrChk=$("input[name='chk_list'][checked]");
$ (arrChk).each(function(){
window.alert(this.value);
$("#checkbox_id").attr("checked"); //Get the status of a CheckBox (whether it is selected, return true/false)
$("#checkbox_id").attr("checked",true); //Set the status of a CheckBox to checked (checked=true)