Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

DOMStringMap

这篇文章需要文法复核。如何帮忙。

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

方法预览

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!

方法

Native code only!

getDataAttr

DOMString getDataAttr(
  in DOMString prop
);
参数
prop
属性名
返回值

     指定属性名的值

Violates the XPCOM interface guidelines

hasDataAttr()

boolean hasDataAttr(
  in DOMString prop
);
参数
prop
属性名
返回值

  如果该属性存在则返回 true,否则返回 false

Violates the XPCOM interface guidelines

removeDataAttr()

void removeDataAttr(
  in DOMString prop
);
参数
prop
属性名

Violates the XPCOM interface guidelines

removeProp()

移除属性,当移除的是 data-* 属性时更新整个数据集

void removeProp(
  in nsIAtom attr
);
参数
attr
属性名

Native code only!

setDataAttr

给指定属性赋值

void setDataAttr(
  in DOMString prop,
  in DOMString value
);
参数
prop
属性名
value
属性值

浏览器兼容性

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 ? ? ? ? ?

参见

文档标签和贡献者

 此页面的贡献者: ShiJianwen, lann1986, FredWe
 最后编辑者: ShiJianwen,