Very well-made tutorial! Love the imagery and how you annotate/explain the code blocks.
I definitely recommend looking into the details HTML element. Besides no longer needing Javascript, it also makes the accordion more accessible, allowing assistive tools like screen readers to announce when something can be collapsed or expanded.
Using just divs, you would have to manually add aria roles, labels, and possibly controls to achieve the same thing.
I'm a full-stack developer who loves to write about software programming and technology in general. Need a freelancer or want to collaborate? Send an email to my address below.
Very well-made tutorial! Love the imagery and how you annotate/explain the code blocks.
I definitely recommend looking into the details HTML element. Besides no longer needing Javascript, it also makes the accordion more accessible, allowing assistive tools like screen readers to announce when something can be collapsed or expanded.
Using just divs, you would have to manually add aria roles, labels, and possibly controls to achieve the same thing.
Hi Timothy,
Thanks a lot.