lundi 29 juin 2015

jquery double counts my checkboxes

I'm trying to get all of the checked checkboxes on my page using jquery, but it appears that jquery is counting boxes with the checked="checked" attribute as well as boxes that actually appear to be checked.

I am using the following code to retrieve the checked boxes: $("input:checkbox[name='repo_filter']:checked");

With the checkboxes getting generated like this:
<input type="checkbox" name="repo_filter" checked="checked">

It returns that there is a checkbox checked if the box originally had the checked attribute even if it was since unchecked.

Any help is much appreciated.




Aucun commentaire:

Enregistrer un commentaire