I’m working on a simple jQuery element but I can’t seem to select the right div. I have 2 divs called “container_vragen” and inside the div are some hidden div’s. Now I have some buttons that shows that hidden div but it shows it in both “container_vragen” divs. But I want to show it in only one of the divs.
$('.open_sub_ja , .open_sub_no').click(function() {
$(this).parents().find('.submenu').fadeIn(500);
});
$('.akkoord').click(function() {
$(this).parents().find('.submenu').fadeOut(500);
});
I have a small jsFiddle here http://jsfiddle.net/YGArt/
You can filter your ancestor with a selector :
Updated fiddle.