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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -