Toggle next element on click


/ Published in: jQuery
Save to your folder(s)

Make elements with the "toggle-next" class show/hide the following element when clicked.


Copy this code and paste it in your HTML
  1. jQuery( function( $ ) {
  2. $( '.toggle-next + *' ).hide();
  3. $( '.toggle-next' ).click( function() {
  4. $( this ).next().slideToggle( 'fast' );
  5. return false;
  6. } );
  7. } );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.