jquery - Toggle div based on checkbox value -
i'm not sure how accomplish this. want hide div based on checkbox value. code toggle.
appreciate help
.always checkbox
$(document).ready(function () { $('.always').click(function () { $('#dates').toggle(); }); });
.toggle()
takes boolean well, this:
$(function () { $('.always').change(function () { $('#dates').toggle(!this.checked); }).change(); //ensure visible state matches });
you can test out here. assume in above want #dates
hidden if .always
checked, that's it'll do.
Comments
Post a Comment