---
title: tabindex Not Above 0 | Accessibility Rule
description: Elements should not have tabindex greater than zero
source_url:
  html: https://testingbot.com/support/accessibility/web/rules/tabindex
  md: https://testingbot.com/support/accessibility/web/rules/tabindex/index.md
---
# Make sure tabindex attribute values are not greater than 0

Rule ID: tabindexUser Impact: seriousGuidelines: Best Practices

The `tabindex` rule ensures that `tabindex` attributes with a value greater than 0 are not used, as they can create confusing and unpredictable tab navigation.

## What is being tested?

This rule checks that:

- No element uses `tabindex` with a value greater than 0.
- Tab order follows the logical flow of the DOM, not an artificially assigned order.

## Why it matters

Using `tabindex` greater than 0 disrupts the natural tabbing sequence, causing:

- Unexpected tab order that disorients users.
- Elements that seem skipped because they were already tabbed early.
- Unintuitive focus movement, especially when combined with complex page layouts or CSS.

## How to fix the problem

- Change `tabindex` values \> 0 to `0` to include the element in normal tab flow.
- Remove `tabindex` and reorder HTML so the DOM flow matches the desired tab order.
- Use `tabindex="-1"` plus JavaScript when you need an element to be focusable only programmatically.

## Examples

**Correct use:**

    <button tabindex="0">Click me</button>
    <div tabindex="-1">Focusable only with JS</div>

**Incorrect use:**

    <button tabindex="5">Click me</button>
    <a href="#" tabindex="10">Skip link</a>

## Best practices

- Let the natural HTML flow control tab order whenever possible.
- Avoid adding `tabindex` to non-interactive elements like `<div>` or `<span>` unless absolutely necessary.
- Be cautious with CSS layouts (like `position: absolute` or `float`) as they can visually reorder elements and create confusing tab flows.

## Other Rules

Interested in other web accessibility rules? Please see these other rules:

- [table-duplicate-name](https://testingbot.com/support/accessibility/web/rules/table-duplicate-name)
- [color-contrast-enhanced](https://testingbot.com/support/accessibility/web/rules/color-contrast-enhanced)
- [identical-links-same-purpose](https://testingbot.com/support/accessibility/web/rules/identical-links-same-purpose)
- [meta-refresh-no-exceptions](https://testingbot.com/support/accessibility/web/rules/meta-refresh-no-exceptions)
- [css-orientation-lock](https://testingbot.com/support/accessibility/web/rules/css-orientation-lock)
