Very Easy Accordion With jQuery From Scratch
This is an accordion I wrote for a site a while back. I turn to this code every time I need a quick and easy accordion for a site.
Here is what the html markup will look like, a header div then a div right after that will hold all of the content of the slide accordion.
Then to make it all work, we need to add this easy jQuery script.
The only CSS that is required for this to work properly is the following:
This just hides the content right off the bat, as soon as the page loads, then once the header div is clicked, you will see the content slide down.
View Codepen Demo
See the Pen Easy Accordion With jQuery by calebnance (@calebnance) on CodePen.