Created
November 12, 2015 08:19
-
-
Save b0n/679862820d7870b9a11d to your computer and use it in GitHub Desktop.
Checkbox family checked each other between parent and childrens.
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
$(function() { | |
$("#search > div > div.box.f-left > ul > li > input.genre").each(function() { | |
$(this).prop('checked', true); | |
if (!$(this).next().next().find('input:checkbox').prop('checked')) { | |
$(this).prop('checked', false); | |
} | |
}); | |
$("#search > div > div.box.f-left > ul > li > input.genre").bind('change', function() { | |
$(this).next().next().find('input:checkbox').prop('checked', this.checked); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment