Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2015 г..
Used by the dataset HTML attribute to represent data for custom attributes added to elements.
| boolean hasDataAttr(in DOMString prop); |
| void removeDataAttr(in DOMString prop); |
| void removeProp(in nsIAtom attr); |
| void setDataAttr(in DOMString prop, in DOMString value); |
The property for which to check for the existence of a value.
true if the property exists; otherwise false.
The property to remove from the data set.
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 );The property to remove from the dataset.
Enable JavaScript to view this browser compatibility table.
This page was last modified on 15 апр. 2025 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.