Check All Checkboxes with JQuery Plugins

A jQuery plugin is simply a way to put your code into a package. It makes it easier to maintain and use in different projects.

I have created sample jquery plugin for checking all checkboxes at one click. Also you can select odd or even row using this plugin. You need to give class of child checkboxes. Remember, Class name must be same for all.

This plugins have three attributes.

1. child – It contains name of class which is assinged to child checkboxes.
2. odd – It contains boolean value either true or false. default value is false;
3. even – It also contains boolean value either true or false. defaule value is false;

Demo Download

child : ‘child’,
odd : true

jQuery.checkAll.js contains
// Check and uncheck all check boxes
checkall: function(options){
var defaults = {
child : ”,
odd : false,
even : false
var opts = $.extend({},defaults, options);
return this.each(function(){
obj = $(this);{
var checkStatus = $(obj).attr(‘checked’);
if(opts.odd == true){
}else if(opts.even == true){