Fiido93 Fiido93 - 5 months ago 13
jQuery Question

Hide and show Jquery

I think i have done a right thing, I click the button and the paragraph doesn't appear. Can anyone help me why with my jQuery?

$('.open').on('click',function(event){
$(this).nextAll('.ranch').toggle();
});


DEMO

Answer

There is no jquery plugin attached in your html. Please check console for error.

http://codepen.io/SESN/pen/WxxZOg

Here is your answer

 $('.open').on('click',function(){
 $(this).closest('.content').find('p.ranch').toggle();
 });