I've got a website set up with well structured pages, eg. <h1>
for the website name, <h2>
for the page name and <h3>
for the different sections on the page.
Anyway, I was looking to set a bunch of the really long pages (an FAQ page for example) up with an "accordion" effect, with the <h3>
elements being the toggle and the content directly following being toggled. But the collapsible content needs to be in it's own <div class="draw">
(or similar) and this isn't how the content is set up currently. I was hoping this was possible without touching the existing HTML and just somehow changing the DOM with JS (with jQuery assistance?) to accommodate.
I thought maybe wrapping content between the <h3>
elements in a classed <div>
might work but wouldn't know how to get this done. Help?