Skip to content

data

data(element, name): string | null

Defined in: core/dom/attributes.ts:9

Returns the value of a data-* attribute, or null if it is not set.

Reads the attribute directly because element.dataset does not exist in IE10.

Element

Element to read from.

string

Attribute name without the data- prefix.

string | null