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
Post a Comment