Jquery - Using an id to slide in content with slideToggle
<p>I need to use the ID of a div to slide down its contents. At the moment it seems to be sliding down all the "fullMessage" divs and displaying their contents. I have looked at using <code>.parent()</code> and <code>.closest()</code> but I thought the id approach would be better, I may be wrong.</p>

<p>// JS</p>

<pre><code>$('#messageBox .message .subject').click(function(){
        var id = $(this).attr("id");
       $('.fullMessage #' + id).slideToggle("slow");
});
</code></pre>

<p>// HTML</p>

<pre><code>&lt;div id="messageBox"&gt;
    &lt;?php foreach ($messages as $message): ?&gt;
        &lt;div class="message"&gt;
            &lt;div class="subject"&gt;
                &lt;a href="" id="&lt;?php echo $message['id']; ?&gt;"&gt;
                &lt;?php echo $message['subject']; ?&gt;
            &lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="fullMessage" id="&lt;?php echo $message['id']; ?&gt;"&gt;
        &lt;?php echo $message['message']; ?&gt;
    &lt;/div&gt;
    &lt;?php endforeach; ?&gt;
&lt;/div&gt;
</code></pre>

<p>Any help on this would be much appreciated :)</p>
