I had a problem, and this answer solved it. It uses the property tabIndex
.
Is this property cross-browser? Which browsers support it?
Normally I would use Google for this, but oddly, nothing about this (except w3schools) appeared in my search query, and w3schools is terrible and doesn't show which browser versions are supported, only which browsers. MDN doesn't say anything about it either.
Definition and Usage The tabIndex property sets or returns the value of the tabindex attribute of an element. The tabindex attribute specifies the tab order of an element, when the "tab" button is used for navigating.
A negative value (usually tabindex="-1" ) means that the element is not reachable via sequential keyboard navigation, but could be focused with JavaScript or visually by clicking with the mouse. It's mostly useful to create accessible widgets with JavaScript.
tabindex is a global attribute that allows an HTML element to receive focus. It needs a value of zero or a negative number in order to work in an accessible way. When tabindex 's value is set to zero or a positive number, the element can be navigated to via the keyboard's Tab key.
When positive numbers are used for tabindex , those elements become the first things users tab to in a web page. The result is that items on the page are placed out of order in terms of tab flow.
tabIndex
is so old, it has been standard since the earliest versions of browsers. In fact, it might even have been a part of the first ever HTML spec, although I can't say that for certain.
Basically, the reason you can't find compatibility tables is because everything supports it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With