「Attribute」 Object Properties and Methods

 

此文章只列出可用來操作Attribute Object的屬性與方法。

Property / Method Description
attr.isId Returns true if the attribute is of type Id, otherwise it returns false
attr.name Returns the name of an attribute
attr.value Sets or returns the value of the attribute
attr.specified Returns true if the attribute has been specified, otherwise it returns false
nodemap.getNamedItem() Returns a specified attribute node from a NamedNodeMap
nodemap.item() Returns the attribute node at a specified index in a NamedNodeMap
nodemap.length Returns the number of attribute nodes in a NamedNodeMap
nodemap.removeNamedItem() Removes a specified attribute node
nodemap.setNamedItem() Sets the specified attribute node (by name)

 

參考資料:

Attribute Object Properties and Methods