How to create a div with jQuery accordion
<p>Im using this:  </p>

<pre><code>&lt;script&gt;
    $(function() {
        $( "#accordion" ).accordion();
    });
&lt;/script&gt;
</code></pre>

<p>To get the effect of expand/collapse. (If you know a better plugin or method, pls notice me)</p>

<p>I have this div: <code>&lt;div id ="accordion"&gt;&lt;/div&gt;</code></p>

<p>And this code to create a button inside that div. (dont worry about the content of button)</p>

<pre><code>$('#button_submit').click(function() 
{
$("#accordion").append(
$("&lt;button id=saved"+j+"&gt;").click(function() {
drawChart.apply(null, myArray);
}).html("&lt;b&gt;Start date:&lt;/b&gt;"+""+myArray[0]+"\n&lt;b&gt;End date:&lt;/b&gt;"+myArray[1]+"\n&lt;b&gt;Chart type:&lt;/b&gt;"+myArray[2]+"")
);
</code></pre>

<p>My question is, how to create/format div accordion to have this effect <a href="http://jqueryui.com/accordion/" rel="nofollow">accordion effect jquery</a> . </p>

<p>being that the <code>&lt;button id=saved"+j+"&gt;</code> should appear inside the <code>sections</code>.</p>

<p>Cheers</p>
