Jquery .next() not working as expected
jquery
Solution
In your case this should work:
$(this).nextAll('div:first').slideDown();
Problem
So I've got this html ``` <div id="content_div"> <div> <img src=""/> <img src="" /> <img src="" /> <div class="test"> </div> <img src="" /> <img src="" /> <img src="" /> <div class="test"> </div> </div> </div> ``` And this Jquery ``` $("#content_div > div > img").click(function() { $(this).next("div").slideDown(); }); ``` When I click on image ( Which I have in my code, not here though) I am expecting next div(after clicked image) to slidedown but nothing happens. I'm almost sure that I'm selecting it wrong because if I change $(this).next("div").slideDown(); to $(".test").slideDown(); it works, though both divs opens and I just want to open one, what's the problem? (I have a proper css, so that's not the case)