Create your own little accordions with javascript, no plugin needed - great for html sites, or platforms a plugin cannot be used / added


<h1 class="expand">
<a id="expand" href="javascript:expand('expand-content','expand');" >TITLE +</a>

<div id="expand-content" style="display: none;">Content</div>



<script type="text/javascript">
function expand(showHideDiv, switchTextDiv) {
var ele = document.getElementById(showHideDiv);
var text = document.getElementById(switchTextDiv);
if( == "block") { = "none";
else { = "block";

**make sure to each collapsible block has a unique ID “expand-content” “expand-content-2” etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.