Good evening, I'd like to know how I can hide and show my div
with class clic
as checkbox
selected. I have several checkbox
and as I select or deselect checkbox
I want it to show the element and hide if I deselect it. I tried the following way:
HTML:
<div class="clic" style="display:none"></div>
jQuery:
if ($(this.checked)) {
$(this).closest(".hovereffect").find(".clic").css("display", "block");
} else {
$(this).closest(".hovereffect").find(".clic").css("display", "none");
}
With this code I can insert the element but when I unselect the element it would have to hide the class click again and it does not hide anyone could help me?