javascript - Toggle the nearest content when click on anchor using jQuery -


i have content structure this:

<a href="#" class="toggle_button">click me.</a> <p class="hidden_content">this content toggleable.</p>  <a href="#" class="toggle_button">click me.</a> <p class="hidden_content">this different section.</p>  <a href="#" class="toggle_button">click me.</a> <p class="hidden_content">this section different.</p> 

i have discovered how make work 1 section, how can make when click on toggle_button opens nearest hidden_content class.

$('a.toggle_button').click(function() {     $(this).next('p.hidden_content').toggle(); } 

http://api.jquery.com/next/


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

curl - PHP fsockopen help required -