Skip to content

Instantly share code, notes, and snippets.

@ToJans
Created April 16, 2014 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToJans/10858351 to your computer and use it in GitHub Desktop.
Save ToJans/10858351 to your computer and use it in GitHub Desktop.
$el.find("input[type=checkbox]").change(function () {
var checked = $(this).is(":checked");
var $parent = $($(this).parent());
$parent.find("input[type=checkbox]").each(function () {
if (checked) {
$(this).attr("checked", "checked");
}
else {
$(this).removeAttr("checked");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment