I've got jquery all set up to find my select All check box, but for some reason it only selects all on the second click.
Any ideas would be greatly appreciated.
$("h2 #selectAllState").click(function () {
var here = $(this).closest("div").attr('id');
var stateDiv = "#"+here;
var cityList = "#state"+here;
$(stateDiv+" h2 input:checkbox").change(function () {
$(cityList).find(':checkbox').prop("checked", this.checked);
});
});
Or is a jfiddle