Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM tabIndex property

HTML DOM tabIndex property

Element Object Reference Element object


Definition and Usage

The tabIndex property sets or returns the tab order of a radio button.

Syntax

HTMLElementObject.tabIndex=

tabIndex


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the tabIndex property


Example

Example

Change the tab order of three links:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>

Runoob Tutorial(runoob.com)

title

<

script

function changeTabIndex() { document.getElementById('1').tabIndex="3" document.getElementById('2').tabIndex="2" document.getElementById('3').tabIndex="1" }

script

head

<body>
<p>
<a id="1" href="https://www.runoob.com" 1 a p>
<p>
<a id="2" href="https://www.runoob.com" 2 a p>
<p>
<a id="3" href="https://www.runoob.com" 3 a p>
<input type="button" onclick="changeTabIndex()" value=">

Change TabIndex

"

body

html

Try it »


Element Object Reference Element object