Posted By

marcelodornelas on 03/15/10


Tagged

this jquery


Versions (?)

jQuery - using $(this)


 / Published in: jQuery
 

Show/hide an paragraph when you click on the h2, suppose you have:

Designer info

Lorem ipsum dolor sit amet.

You can show/hide the paragraph with the code below.

  1. $('h2').click(function()
  2. {
  3. $(this).next().toggle('slow');
  4. })

Report this snippet  

You need to login to post a comment.