Wednesday, December 7, 2011

Select & unselect all check box using jquery or Check & uncheck all check box using jquery

$(document).ready(function() {

$("#checkall").click(function()
{
var chk_sts = this.checked;
$('input:checkbox[name=checkboxname]').each(function(i)
{
this.checked = chk_sts;
});
});

});

* Include latest jquery js file
* "#checkall" is the id to check box where you want a click to check all other check boxes

No comments:

Post a Comment