javascript - Jquery how to select elements below an id/class without being the parent? -


i trying make button toggles every <p> below it.

here html:

<p>show</p> <p>show</p> <p>show</p>  <a id="hc-more-info">more info</a>  <p>hide</p> <p>hide</p> <p>hide</p> <ul> ... <ul> 

jquery (this got far) how start them hiden?

jquery('#hc-more-info').click(function(){         jquery(this).parent().nextall('p, ul').toggle();     }); 

any appreciated! thanks!

jquery('#hc-more-info').click(function(){         jquery(this).parent().nextall('p').toggle(); }); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -