Return to Snippet

Revision: 24898
at March 15, 2010 11:39 by marcelodornelas


Initial Code
$('h2').click(function() 
{
    $(this).next().toggle('slow');
})

Initial URL

                                

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

<h2><a href="#">Designer info</a></h2>
<p>Lorem ipsum dolor sit amet.</p>

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

Initial Title
jQuery - using $(this)

Initial Tags
jquery

Initial Language
jQuery