(function($) {$.fn.tshift = function() {var start = 0; var checkboxes = $("#"+ this.attr('id') +" :checkbox"); checkboxes.on("click", function(event) {if(this.checked) {if(event.shiftKey) {end = checkboxes.index(this); if(end < start) {end   = start; start = checkboxes.index(this); } checkboxes.each(function(index) {if (index >= start && index < end) {this.checked = true; } }); } start = checkboxes.index(this); } }); return this; }; })(jQuery);
