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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -