HTMLElement.tabIndex

  • Revision slug: Web/API/element.tabIndex
  • Revision title: element.tabIndex
  • Revision id: 406501
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment Moved From DOM/element.tabIndex to Web/API/element.tabIndex

Revision Content

{{DomRef}}

Summary

Gets/sets the tab order of the current element.

Syntax

element.tabIndex = iIndex
  • iIndex : number

Example

var b1 = document.getElementById("button1");
 
b1.tabIndex = 1;

Specification

  • {{spec("http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-40676705","W3C DOM Level 2 HTML tabIndex","REC")}}

See also

Revision Source

<div>{{DomRef}}</div>

<h2 id="Summary" name="Summary">Summary</h2>
<p>Gets/sets the tab order of the current element.</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
element.tabIndex = <var>iIndex</var>
</pre>

<ul>
  <li><var>iIndex</var> : number</li>
</ul>

<h2 id="Example" name="Example">Example</h2>

<pre class="brush:js">
var b1 = document.getElementById("button1");
 
b1.tabIndex = 1;
</pre>

<h2 id="Specification" name="Specification">Specification</h2>
<ul>
<li>{{spec("http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-40676705","W3C DOM Level 2 HTML tabIndex","REC")}}</li>
</ul>

<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Accessibility/Keyboard-navigable_JavaScript_widgets" title="Accessibility/Keyboard-navigable_JavaScript_widgets">Accessibility / Keyboard-navigable JavaScript widgets</a></li>
</ul>
Revert to this revision