W3.CSS

Accordions

An accordion is used to show (and hide) HTML content:

Section 1

Some text..

function myFunction(id) { var x = document.getElementById(id); if (x.className.indexOf("w3-show") == -1) { x.className += " w3-show"; } else { x.className = x.className.replace(" w3-show", ""); } }