Un deuxième pense-bête, sur le champ "checkbox"
Soit le code HTML suivant:
<input type="checkbox" name="haricot" /> Haricot <input type="checkbox" name="carotte" /> Carotte <input type="checkbox" name="champignon" /> Champignon
Savoir si un checkbox est coché
$('input:checkbox[name=haricot]').is(':checked');
Cocher / décocher une checkbox
$('input:checkbox[name=haricot]').attr('checked', true);
Parcourir les checkbox cochés
$("#formLegumes input[type=checkbox]:checked") .each(function(){ console.log($(this)); });