You cannot make the accordion work with your current markup. Elements must be the same siblings:
<div id="parentAccordionDiv">
<h3><a href="#">header</a></h3>
<div>
Content goes here
</div>
<h3><a href="#">header</a></h3>
<div>
Content goes here
</div>
</div>
I stand fixed. I got an accordion to work like this:
<script type="text/javascript">
$(function(){
$('#accordion').accordion();
})
</script>
<ul id="accordion">
<li>
<h3><a href="#">header</a></h3>
<div>
Content goes here
</div>
</li>
<li>
<h3><a href="#">header</a></h3>
<div>
Content goes here
</div>
</li>
</ul>
source
share