As far as I know, you should structure your document, as in the examples.
jQuery looks for a header with an anchor, followed by a div block, etc.
Example:
<div id="accordion"> <h3><a href="#">First header</a></h3> <div>First content</div> <h3><a href="#">Second header</a></h3> <div>Second content</div> </div>
So you have to use jQuery markup, otherwise jQuery will not recognize your content.
Another problem with your <ul> list is that jQuery does not know which part is the header and which part is the content.
At this point you have several options:
- You can find the corresponding lines of code in jQuery and edit them (not recommended)
- You can write your own accordion (based on the original)
- (If you really need your
<ul> list), you can exchange the <ul> and <li> tags at run time with the corresponding jQuery tags - Use jQuery markup (recommended)
Best wishes
source share