Hello I am trying to make a simple java script to mark as checked all check boxes with the same ID, once you check one of them. The problem comes from there that first state the check box is unchecked when I check it it works, when I uncheck it it works it does uncheck all the boxes with the same id again but after that if I try to check it again it does not works.
Here is my code so far:
$('input[id="check_01"]').on('click',function(){
$('input[id="check_01"]').attr('checked', $(this).is(':checked'))
});
Let me know what the logic of this should be to fix it ? In JS Fiddle it works perfect but not on my web form.
this is the input's code:
<input type="checkbox" class="aboveage6" id="check_01" name="utilities[]" value="1 parking" /> 12<br />
<input type="checkbox" class="aboveage6" id="check_01" name="utilities_02[]" value="1 parqueo" /> 12 2<br />
Aucun commentaire:
Enregistrer un commentaire