22
loading...
This website collects cookies to deliver better user experience
Prerequesites: I will assume you have some basic understandig of accessibility concepts, if you don’t I recommend to read “Part 1: Introduction” before diving into this blog post.
<button>
instead of <div role="button">
//using ARIA role
<div role="banner">
This is the header area of my website
<img src="logo.jpg" />
</div>
//using semantic HTML
<header>
This is the header area of my website
<img src="logo.jpg" />
</header>
<div role="tablist">
<button role="tab"> TAB 1</button>
<button role="tab" >TAB 2</button>
</div>
<div role="tabpanel">My first tab</div>
<div role="tabpanel">My second tab</div>
<div>
a role="tablist". And inside it are two buttons that both have a role="tab". Without these roles it would be impossible for assisitve technology to understand this part of the website.<div role="tablist">
<button role="tab"
aria-selected="true"
aria-controls="tab-1">
TAB 1
</button>
<button role="tab"
aria-selected="false "
aria-controls="tab-2">
TAB 2
</button>
</div>
<div role="tabpanel" aria-labelledby="tab1" id="tab-1">My first tab</div>
<div role="tabpanel" aria-labelledby="tab2" id="tab-2">My second tab</div>
<button aria-describedby="openDialogInfo">Open dialog</button>
<div id="openDialogInfo">
This will open the form in a dialog. All changes you have allready made will be lost.
</div>