+ 1
How to make accordion via javascript?
How to make an accordion for element something like <div class="mytitle> My accordion title </div> <span class="mycontent> my content visible only on clicking title (drop down) </span>
1 Respuesta
+ 1
You can try <summary> with <details>.
https://www.w3schools.com/tags/tag_summary.asp
(Edit)
If you want to use JavaScript instead, you can handle the click event for the div, wherein you manipulate the `display` style of the span. But with summary-details it's easier.