accordion of div's
<p>I am making an accordion of Div's here is the code:</p>

<pre><code> $('.answer').hide();
 $('.question').click (function(){
    $('.answer').slideUp();
    $('#question'+$(this).attr('target')).slideDown('slow');
 })
</code></pre>

<p>It is working fine, but I want it so when I click again on same question it closes.<br>
Here is the HTML I used :</p>

<pre><code>&lt;h1 class="question" target="1"&gt;Some Question&lt;/h1&gt;
&lt;p id="question1" class="answer"&gt;Some Answer&lt;/p&gt;
&lt;h1 class="question" target="2"&gt;Another question&lt;/h1&gt;
&lt;p id="question2" class="answer"&gt;Another answer&lt;/p&gt;
</code></pre>

<p>Thanks in advance</p>

<p>please look the code here : <a href="http://jsfiddle.net/FMLhc/" rel="nofollow">http://jsfiddle.net/FMLhc/</a></p>
