DOMStringMap

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Used by the dataset HTML attribute to represent data for custom attributes added to elements.

Доступные методы

DOMString getDataAttr(in DOMString prop);
boolean hasDataAttr(in DOMString prop);
void removeDataAttr(in DOMString prop);
void removeProp(in nsIAtom attr);
void setDataAttr(in DOMString prop, in DOMString value);

Методы

hasDataAttr()

boolean hasDataAttr(
  in DOMString prop
);

Аргументы

prop

The property for which to check for the existence of a value.

Возвращаемое значение

true if the property exists; otherwise false.

removeDataAttr()

void removeDataAttr(
  in DOMString prop
);

Parameters

prop

The property to remove from the data set.

removeProp()

Removes the property from the dataset object. Used to update the dataset object when data-* attribute has been removed from the element.

void removeProp(
  in nsIAtom attr
);

Parameters

attr

The property to remove from the dataset.

Совместимость с браузерами

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
DOMStringMap

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Смотрите также