I currently have the following html:
<h3 />
<p />
<p />
<ul />
<ol />
<h3 />
<p />
<p />
<ul />
<ol />
<h3 />
<p />
<p />
<ul />
<ol />
I would like to create an accordion, but for this I need the following:
<h3 />
<div>
<p />
<p />
<ul />
<ol />
</div>
<h3 />
<div>
<p />
<p />
<ul />
<ol />
</div>
I tried the following, but it does not work:
$('.page2 .articleText p, .page2 .articleText ul').after('<div class="accordion">');
$('.page2 .articleText h4:not(:first)').before('</div>');
Any help is greatly appreciated.
Thank!
source
share