i have div that have image, label and input check-box. what i like when i click on div, it change check-box status from true to false and vise verse
jQuery
$(".markerDiv").click(function () {
if ($(this).find('input:checkbox[name=markerType]').is(":checked")) {
$(this).find('input:checkbox[name=markerType]').attr("checked", false);
}
else {
$(this).find('input:checkbox[name=markerType]').attr("checked", true);
}
alert($(this).find('input:checkbox[name=markerType]').is(":checked"));
});
html
<div class="markerDiv" id="maker_school"><label class="marker_label">School</label> <input class="marker_ckeckbox" name="markerType" value="school" type="checkbox" /> </div> <br />