Element: ariaColCount property

Baseline 2023
Newly available

Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The ariaColCount property of the Element interface reflects the value of the aria-colcount attribute, which defines the number of columns in a table, grid, or treegrid.

Value

A string.

Examples

In this example the aria-colcount attribute on the element with an ID of semantic-table is set to "2". Using ariaColCount we update the value to "3".

html
Semantic Elements to use instead of ARIA's roles
ARIA Role Semantic Element
header h1
header h6
rowgroup thead
term dt
js
let el = document.getElementById("semantic-table");
console.log(el.ariaColCount); // 2
el.ariaColCount = "3";
console.log(el.ariaColCount); // 3

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariacolcount

Browser compatibility

See also