I\'m working on a form for a client and he has given me the task to create a show/hide effect when certain checkbox in unselected.
This function should do it:
$("#yourCheckboxID").click(function ()
{
if ($("#yourCheckboxID").attr("checked"))
{
$("#yourDivID").show();
}
else
{
$("#yourDivID").hide();
}
});
It will hide or show a specific div
based on a checkbox
. I wasn't sure exactly what you were trying to hide or show so I just assumed a div
.
$("#checkboxID").change(function() { $("#targetToHideAndShow").toggle() } );