English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML-Referenzhandbuch

HTML-Tagverzeichnis

HTML tabindex-Eigenschaft

tabindex-globale Eigenschaft gibt an, ob ein Element fokussiert werden kann und es/Wo am Navigationsschema der Tastatur teilnimmt (normalerweise mit der Taste Tab, daher der Name).

Globale Attribute von HTML

Hinweis: Der maximale Wert von tabindex sollte nicht überschreiten 32767。Wenn nicht angegeben, ist der Standardwert -1。

Online-Beispiel

Verknüpfungen in der angegebenen tabindex-Reihenfolge verknüpfen:

!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Verwendung der HTML tabindex-Eigenschaft (Grundtutorialsite oldtoolbag.com)</title>
</head>
<body>
<div tabindex="1">oldtoolbag.com</div><br>
<div tabindex="3">google.com</div><br>
<div tabindex="2">microsoft.com</div>
<script>
// Am Anfang, den Fokus auf das erste div setzen
document.getElementsByTagName('div')[0].focus();
</script>
<p tabindex="4<b>Hinweis:</Versuchen Sie, die Elemente durch die Verwendung der "Tab"- Taste auf Ihrer Tastatur zu navigieren./p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the tabindex attribute

Definition and Usage

The tabindex attribute specifies the tab order of elements (when navigating using the 'tab' button).

HTML 4.01 with HTML5differences

In HTML5In HTML, the tabindex attribute can be used on any HTML element (it will be validated on any HTML element. However, it may not be useful).

In HTML 4.01In the syntax, the tabindex attribute can be used with <a>, <area>, <button>, <input>, <object>, <select>, and <textarea>.

Syntax

        <element tabindex="number">

Attribute Value

ValueDescription
numberDefine the tab key control order (1 is the first).
Globale Attribute von HTML