Search code examples
htmltabindex

tabindex - - is it widely supported?


I'm starting some work on some input fields.

I have a decision to make whether to carry out an action on the input:focus itself, or on a larger parent area focus.

In order to make the parent focusable, I intend to add a tabindex -1.

I've looked around and know that this stuff has been around a long time, but before I set off on a particular route, it would be good to know whether this works cross browser.

In terms of browsers I need to support, IE10 up, Chrome, Firefox, and the new "IE6", Android (3.0 upwards).

I'd appreciate any feedback as this is not something I can find out on caniuse and not something I can test widely at this stage.


Solution

  • Yes and no.

    The HTML5 specification's notes on tabindex state:

    If the value is a negative integer
    The user agent must set the element's tabindex focus flag, but should not allow the element to be reached using sequential focus navigation.

    However the HTML401 specification's notes on tabindex state:

    This attribute specifies the position of the current element in the tabbing order for the current document. This value must be a number between 0 and 32767. User agents should ignore leading zeros.

    If the browser supports HTML5 or ignores the HTML401 specification's implementation notes you're good to go. I have no idea what you mean by the new "IE6", but the other browsers you mention all implement HTML5.