How to find an element outside its parent using jQuery
I have this markup:
<div> <div> <button class="button"></button> </div> <div class="panel"> </div> </div> Now I need to find the next panel right on the right for the button element and do some action on it. So I do this, but something is wrong, can someone help?
var open_bt = $('.button'); open_bt.on('click',function(){ $(this).parent().parent().next().child('.panel').slideDown(100); }); Thanks for reference.
+4
3 answers