Element.ariaRowIndex is an instance property that reflects the aria-rowindex attribute. Learn how it declares a cell or header’s 1-based row position within a table, grid, or treegrid, how it pairs with ariaRowCount, and how to get or set it from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String (integer)
03
Meaning
1-based row position
04
Reflects
aria-rowindex
05
Status
Baseline widely
06
Used on
Cells / headers
Fundamentals
Introduction
When a table or grid shows only some rows (or skips rows in a virtualized list), assistive technologies still need to know which logical row a cell belongs to.
That is what aria-rowindex communicates. The DOM property ariaRowIndex lets you read and update that position from JavaScript.
JavaScript
const el = document.getElementById("role-heading");
console.log(el.ariaRowIndex); // "1"
el.ariaRowIndex = "2";
💡
Beginner tip
Indexes are 1-based strings ("1", "2", …), not 0-based Numbers. Use ariaRowCount on the table for the total height, and ariaColIndex for the column position.
Concept
Understanding the Property
MDN: the ariaRowIndex property of the Element interface reflects the value of the aria-rowindex attribute, which defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid.
Reflected attribute — mirrors aria-rowindex.
Get / set — readable and writable string integer.
1-based — first row is "1".
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaRowIndex
Value
A string which contains an integer (the row position).
Item
Detail
Type
string containing an integer (e.g. "1", "11")
Reflects
aria-rowindex
Applies to
Cells / headers in table, grid, treegrid patterns
Often paired with
aria-rowcount, aria-colindex
Pattern
📋 Row Index on Header (MDN Shape)
MDN sets aria-rowindex="1" on the header cells (row 1 of a 100-row logical table), with body cells at indexes like 11, 16, and 18. Then it updates #role-heading from "1" to "2" via the property:
Prefer ariaRowIndex in script; keep the attribute for HTML markup.
Example 5 — Support Snapshot
Feature-detect and remember the 1-based rule.
JavaScript
console.log({
supported: "ariaRowIndex" in Element.prototype,
tip: "1-based string integer (first row is \"1\")",
pairsWith: "ariaRowCount on the table/grid",
status: "Baseline Widely available (MDN)"
});
Element.ariaRowIndex is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.ariaRowIndex
String integer — reflects aria-rowindex (1-based row position in table/grid/treegrid).
BaselineWidely available
Google ChromeSupported (ARIA reflection)
Yes
Microsoft EdgeSupported (ARIA reflection)
Yes
Mozilla FirefoxSupported (ARIA reflection)
Yes
Apple SafariSupported (ARIA reflection)
Yes
OperaFollow Chromium support
Yes
Internet ExplorerNo ariaRowIndex IDL — use setAttribute
No
ariaRowIndexBaseline
Bottom line: Use ariaRowIndex to get/set aria-rowindex on cells and headers. Keep 1-based string indexes aligned with your logical row set, especially for virtualized tables. Pair with ariaRowCount for the total height.
Wrap Up
Conclusion
ariaRowIndex reflects aria-rowindex so cells and headers can declare their 1-based row position as a string integer—even when not every row is in the DOM. Update it from JavaScript when the visible slice of your data changes.
Use 1-based string integers that match the logical row
Pair with aria-rowcount on the table/grid
Prefer semantic <table> markup when possible
Update indexes when the visible row window scrolls
Combine with aria-colindex for cell coordinates
❌ Don’t
Use 0-based indexes (ARIA expects 1-based)
Leave stale indexes after rows move or reload
Treat the value as a Number type in string APIs
Exceed aria-rowcount with an out-of-range index
Forget accessible names / captions on complex tables
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaRowIndex
Reflected aria-rowindex string for 1-based row position.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
String integer
1-based row
Type
🔍03
Cells / headers
in grids
Use
✅04
Baseline
widely available
Status
🎯05
Partial DOM
still declare index
Tip
❓ Frequently Asked Questions
It reflects the aria-rowindex attribute as a string integer that defines an element’s row index or position with respect to the total number of rows in a table, grid, or treegrid.
No. MDN marks Element.ariaRowIndex as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string that contains an integer (for example "1" or "2"), not a Number type.
ARIA row indexes are 1-based. The first row is "1", the second is "2", and so on.
ariaRowCount is the total number of rows on the table/grid. ariaRowIndex is the position of a specific cell or header within that total.
Yes. Reading and writing ariaRowIndex updates the reflected aria-rowindex attribute.
Did you know?
MDN’s sample only renders a few body rows, but those cells use aria-rowindex values like 11, 16, and 18—so AT knows where they sit inside aria-rowcount="100".