Example 1 — Read ariaRowSpan
Log how many rows a spanning heading covers.
const el = document.getElementById("spanning-heading");
console.log(el.ariaRowSpan); // "3"
// HTML: <th … rowspan="3" aria-rowspan="3"> How It Works
- Find the cell.
getElementByIdreturns the heading cell. - Read the reflection.
ariaRowSpanreturns thearia-rowspanstring. - Interpret
"3". Assistive technologies treat the cell as covering three rows. - Missing attribute. If unset, many browsers return
null(default meaning is still one row).

