Simple stuff here but I'm new to jQuery from Prototype.

My HTML is like this:

    <div class="feature">
        <h2>Heading Goes Here</h2>
        <img src="photo.jpg" />
        <p>Text goes here</p>
    </div>

// repeat x10

Javascript: (runs on page load)

        $('.feature h2').click(function () {
                         $(this).parent().children("p").slideUp(400);
        });

What I want to happen is for the <p> element inside the .feature class
to appear when the <h2> of that <div> is clicked - make sense?

I tried using next() and a few other methods but it doesn't work as
neatly as I want it to - how can I tell jQuery to just return the <p>
element within that div (and not all <p> elements which are inside
a .feature class)?

Thanks,
Matt

Reply via email to