Something
public javascript v1 · immutablefunction checkAll() { var check = $('div[id="uniform-undefined"] span'); var c; if (check[0].className == "") { c = 'checked'; } else { c = ''; } for(var i = 0; i < check.length; i++) { check[i].className = c; } if (c == '') { $('input[type="checkbox"]').each(function() { $(this).removeAttribute('checked'); }); } else { $('input[type="checkbox"]').each(function() { $(this).attr('checked', true); }); }}