ARIA States
States und Properties / Atributes werden in einem Atemzug genannt. Status sind Properties die einen temporären Zustand eines Elements beschreiben bspw. aria-expanded true/false, aria-disabled, aria-checked oder aria-invalid.
Accordion with <div>
Standard Akkordeon made by Codium AI
This is the content of the first section.
This is the content of the second section.
This is the content of the third section.
Accordion with <div>
Der tabindex
muss gesetzt werden, damit der SR es wieder
vorliest. Weiterhin muss JS geschrieben werden damit neben der Klick
Methode auch die Tastatur berückstichtigt wird.
Best Practises
- keine divs mit
tabindex
nutzen, sondern<button>
inklusive<h3>
, bzw. die semantisch nächste Headline - eine Alternative kann auch
<details>
inklusive<summary>
sein
This is the content of the first section.
This is the content of the second section.
This is the content of the third section.
Accordion with <summary>
Weniger Code gleiche Funktionalität
Accordion Item 1
This is the content of the first section.
Accordion Item 2
This is the content of the second section.
Accordion Item 3
This is the content of the third section.