--- title: DOMStringMap slug: Web/API/DOMStringMap tags: - API translation_of: Web/API/DOMStringMap ---
{{ APIRef("HTML DOM") }}
Used by the {{ htmlattrxref("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); |
boolean hasDataAttr( in DOMString prop );
prop
true
if the property exists; otherwise false
.
void removeDataAttr( in DOMString prop );
prop
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 );
attr
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-dataand send us a pull request.
{{Compat("api.DOMStringMap")}}