Hi,

The HTML structure that is there, I have done it completely using <ul> and <li>, this would make it easier to customize. Here is a sample HTML of the above:
<ul class="acc_options_ul">
<li class="acc_options"><h1 class="acc_options_title">Option 1</h1>
<ul class="acc_op_content_ul">
<li class="acc_op_content">
content of the section.....
</li>
</ul>
</li>
<ul class="acc_op_content_ul">
<li class="acc_op_content">
content of the section.....
</li>
</ul>
</li>
</ul>
The convention that needs to be followed is, the title of the each section of the accordion must be kept inside an <h1> inside the <li class="acc_options"> tags. Each <li class="acc_options"> represents each section. You just need to include the style.css and accordion.js in your page and let the JS take care of the rest.
Explanation:
The functionality of the JS file is very simple. First when the page loads I am opening the first section of the accordion by default by the following:
Explanation:
The functionality of the JS file is very simple. First when the page loads I am opening the first section of the accordion by default by the following: