Not sure how many of this hacked, but I was able to get a div to check and uncheck prettyCheckable. I noticed that when class = "checked" was removed from this prettyCheckable parameter, the checkbox is unchecked.
$("#checkbox").prettyCheckable(); $("#checkboxDiv").click(function() { if ($("#checkbox").is(':checked')) { $("#checkbox").next().removeClass("checked"); $('#checkbox').each(function(){ this.checked = false; }); } else { $("#checkbox").next().addClass("checked"); $('#checkbox').each(function(){ this.checked = true; }); } });
Adding or removing the "checked" class from (which is .next () to the prettyCheckable element) and setting check = true in the original flag element is necessary for it to work. However, my cookie, which can be set, can only validate a field with a class. Like I said, I donβt know how bad this is, but it worked for me, I hope this helps you. Not sure why prettyCheckable doesn't have this ability or at least document it because I didn't find anything.
Micah source share