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

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -