I was working on a minor project which includes a list of records and i need to add a feature where it will allow me to change the status of some or aentire list. Also im learning jquery and decide make use of it here. So here is what i have come-up.
This is just a simple code which checks or uncheck the checkbox for each record if i check or uncheck the main check box at the top of the list.
First we set the path to our jquery
Then our jquery code that will check or uncheck the checkbox.
$(document).ready(function() {
$("#checker").click(function () {
if($(this).is(':checked')){
$("INPUT[type='checkbox'].chk").attr('checked', true);
}
else{
$(".chk").attr('checked', false);
}
});
});
download the sample file here