DOMStringMap

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

Method overview

DOMString getDataAttr(in DOMString prop); Native code only!
boolean hasDataAttr(in DOMString prop); Violates the XPCOM interface guidelines
void removeDataAttr(in DOMString prop); Violates the XPCOM interface guidelines
void removeProp(in nsIAtom attr); Violates the XPCOM interface guidelines
void setDataAttr(in DOMString prop, in DOMString value); Native code only!

Methods

Native code only!

getDataAttr

JavaScript
DOMString getDataAttr(
  in DOMString prop
);
Parameters
prop
The property for which to retrieve the value.
Return value

The value for the specified property name.

Violates the XPCOM interface guidelines

hasDataAttr()

JavaScript
boolean hasDataAttr(
  in DOMString prop
);
Parameters
prop
The property for which to check for the existence of a value.
Return value

true if the property exists; otherwise false.

Violates the XPCOM interface guidelines

removeDataAttr()

JavaScript
void removeDataAttr(
  in DOMString prop
);
Parameters
prop
The property to remove from the data set.

Violates the XPCOM interface guidelines

removeProp()

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

JavaScript
void removeProp(
  in nsIAtom attr
);
Parameters
attr
The property to remove from the dataset.

Native code only!

setDataAttr

Sets the value of the specified property.

JavaScript
void setDataAttr(
  in DOMString prop,
  in DOMString value
);
Parameters
prop
The property whose value is to be set.
value
The property's new value.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 6.0 (6.0) ? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? ?

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/domstringmap

API HTML DOM Interface NeedsBrowserCompatibility NeedsMarkupWork NeedsMobileBrowserCompatibility NeedsNewLayout NeedsUpdate Reference Référence