toggle show and hide div on check box click
I have a group of CheckBox's
- each one toggle display or hide a special div
- and if i click on check box is checked then i need to uncheck this check box and undisplay the div.
How i can do that
i am still new ti jQuery
this is my function :
$(document).ready(function(){
$("input:checkbox").click(function() {
var checkboxgroup = "input:checkbox(name='" + $(this).attr("name") + "')";
$(checkboxgroup).attr("checked", false);
$(this).attr("checked", true);
var divpart = $(this).attr('id');
$(divpart).toggle();
});
});