May 1st, 2019
Today I continued the Applied Accessibility Curriculum in freeCodeCamp.
I started the evening’s session with “accesskey”. It’s an attribute that is usable on any HTML element and allows for keyboard navigation.
It’s particularly useful on interactive elements like buttons, links and form controls.
Inside the “accesskey” attribute we specify a key that functions as a shortcut to activate or bring focus to an element.
<button accesskey="b">Important Button</button>
“tabindex” is also used for keyboard navigation. If put on a tag it indicates that this element can be focused on by using the tab key on the keyboard.
The value of the attribute determines the behavior. It can be a positive or negative integer or zero.
When tabbing through the page, the focus follows the order of the HTML source markup with a tabindex set.
<div tabindex="0">Focus on me</div>
We can decide the order of the elements by using numbers from 1 and up. Tabindex will cycle through these before moving to elements with tabelement=“0” again.
<div tabindex="1">I get focus first!</div>
<div tabindex="2">I get focus second!</div>
And that concluded my Applied Accessibility course.