Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A tabindex of -1 is used to exclude an element from the tab order entirely.</p> <p><strong>Example</strong></p> <pre><code>&lt;input type="text" tabindex="1" /&gt; &lt;input type="text" tabindex="2" /&gt; &lt;input type="text" tabindex="-1" /&gt; &lt;input type="text" tabindex="3" /&gt; </code></pre> <p><a href="http://jsfiddle.net/8S5FE/" rel="nofollow">See this fiddle for an example</a></p> <p>It is fine to use that. See the <a href="http://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute" rel="nofollow">W3C HTML5 specification</a>:</p> <blockquote> <p><strong>If the value is a negative integer</strong></p> <p>The user agent must set the element's tabindex focus flag, but should not allow the element to be reached using sequential focus navigation.</p> </blockquote> <p>I'd say that (from an accessibility standpoint) this approach makes most sense when:</p> <ul> <li>You don't want the menu to be accessed using the keyboard at all</li> </ul> <p>or </p> <ul> <li>You do not know in which environment your code will be used (a jQuery menu could end up below forms whose fields are already covering certain tabindex values, so they couldn't just set the tabindex to anything really) </li> </ul> <p>As for your question regarding the usage of "0" as a tabindex:</p> <p>In the <a href="http://www.w3.org/TR/html401/interact/forms.html#tabbing-navigation" rel="nofollow">HTML specification</a> it says:</p> <blockquote> <p>Elements that have identical tabindex values should be navigated in the order they appear in the character stream.</p> </blockquote> <p>Meaning that you could use any value other than 0 as long as all the elements you want to give a natural tab order to, all have the same tabindex.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload