I use a form where elements hide or show depends on click in the checkbox, it’s working fine
Now I’ll try to fade in another div/form if one of the checkboxes are checked, but nothing happened, does anyone know why?
$('input:checkbox','.checkbox_container').click(function() {
var checked = $(this).prop('checked');
$.each($(this).data("connect").toString().split(","), function(index, value) {
var item = '#item'+value;
(checked) ? $(item)
.fadeOut()
.find("input:checked")
.removeAttr("checked")
: $(item).fadeIn() ;
if (value == 1){
$('#myform')
.html(item) //just for any output
.fadeIn();
}
});
});
Thank’s a lot
Pit
You have to use class selector (
.className), not id (#id):