-
-
Save i-amolo/faa3b5a715b571f6b47ffea6253aa1b9 to your computer and use it in GitHub Desktop.
jQuery - Get the checked items in group of checkboxes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var checked = []; | |
| $("input[name='items[]']:checked").each(function () { | |
| checked.push($(this).val()); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="checkbox" value="one" name="items[]" checked="checked" /> | |
| <label class="float--none">One</label><br /> | |
| <input type="checkbox" value="two" name="items[]" checked="checked" /> | |
| <label class="float--none">Two</label><br /> | |
| <input type="checkbox" value="three" name="items[]" /> | |
| <label class="float--none">Three</label><br /> | |
| <input type="checkbox" value="four" name="items[]" checked="checked" /> | |
| <label class="float--none">Four</label><br /> | |
| <input type="checkbox" value="five" name="items[]" /> | |
| <label class="float--none">Five</label><br /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment