Home

Awesome

Accordion

Simple Accordion done in Vanilla JS.

Usage

  1. Paste right before your page's closing </body> tag:
<script type="text/javascript" src="accordion.js"></script>
  1. Minimum HTML to make it work:
<div class="accordion">
    <h2>Title here</h2>
    <div><!-- HTML here --></div>
    <h2>Title here</h2>
    <div><!-- HTML here --></div>
    <h2>Title here</h2>
    <div><!-- HTML here --></div>
</div>