• blog
  • Build an Accordion Without JavaScript

October 7,2021

Build an Accordion Without JavaScript

byIsev Team Isev Team

accordion-v2
In the pursuit of web performance, we are all looking to come up with clever solutions to make our websites load faster. One way many of us do this is coming up with and stealing (which in this case, the latter is more appropriate) ways of writing less JavaScript.

Many websites I work on include an FAQ section, and nine times out of ten I end up building some form of accordion. But recently I saw a method of building a mobile menu without the use of JavaScript, and I wondered if I could use the same method to build an accordion.

See the Pen Building an Accordion without JavaScript – Part I by Michael (@mjtweaver) on CodePen.

The above pen really simply demonstrates how we can achieve this. We use the label to use as the question, and we also include a checkbox. The checkbox is hidden from view. When we click on the label, it checks the input and then we can use this to display the answer. You’ll notice here we use the general sibling combinator or ~. I wrote some more information on this here. The above example was very simple, how about a styled up version?

After searching on Google, I know others have also used this solution in the past, so it may not be new to you, but it would interesting to get your thoughts.

As a note on browser compatibility, the only thing you have to really consider is the general sibling selector, information can be found here.

Continue Reading

Getting Started with AI: A Practical Guide for SMEs

Artificial Intelligence (AI) is transforming how businesses operate — from how we manage data and communicate with customers, to how we plan marketing, sales, and operations. But for many small and medium-sized enterprises (SMEs), AI still feels slightly out of reach. The good news? It’s not. AI is no longer just for tech giants or … Continued

Isev Team
Isev Team October 14th, 2025
Business Marketing Strategies: Our complete guide

This guide explores essential strategies for Telford businesses looking to expand their reach and improve their marketing performance.

Leanne September 16th, 2025
What is ecommerce? A Complete Guide for 2025

Ecommerce has completely changed the way we consume and sell. From browsing products on websites and apps to buying directly through social media, selling online makes it easier than ever for businesses to reach customers without the high costs of a traditional store. We’ll explore what e-commerce is, how it works, the different types of … Continued

Isev Team
Isev Team September 2nd, 2025
PPC in 2025: Why Your Business Should Consider Using Google Ads

Google Ads remains a powerful and constantly evolving solution. It's an great tool for businesses that want to be seen, stay competitive, and achieve tangible growth

Isev Team
Isev Team August 6th, 2025