Fiido93 Fiido93 - 2 years ago 73
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 Source

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();
 });
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download