Si esistono mille soluzioni, questa per esempio se vuoi mantenere i div per ogni checkbox:
codice:<div> <input type="checkbox" class="ufficio"> <div> <div><input type="checkbox" class="2" value="1"></div> <div><input type="checkbox" class="2" value="2"></div> <div><input type="checkbox" class="2" value="3"></div> </div> </div> $(".ufficio").click(function(){ var isChecked = $(this).attr("checked"); $(this).next().children().each(function(){ $(this).children().attr("checked",isChecked); }); });![]()

Rispondi quotando