Objek ng Attr ng XML DOM
- 上一页 DOM 节点类型
- 下一页 DOM CDATASection
Attr object represents the attribute of the Element object.
Attr object
Attr object represents the attribute of the Element object. The permissible values of the attribute are usually defined in DTD.
Since the Attr object is also a node, it inherits the properties and methods of the Node object. However, attributes cannot have a parent node, and attributes are not considered to be child nodes of the element, and for many properties of the Node object, it will return null.
Properties of the Attr object
Attribute | Description | IE | F | O | W3C |
---|---|---|---|---|---|
baseURI | Return the absolute base URI of the attribute. | No | 1 | No | Yes |
isId | If the attribute is of type id, return true, otherwise return false. | No | No | No | Yes |
localName | Return the local part of the attribute name. | No | 1 | 9 | Yes |
name | Return the name of the attribute. | 5 | 1 | 9 | Yes |
namespaceURI | Return the namespace URI of the attribute. | No | 1 | 9 | Yes |
nodeName | Return the name of the node based on its type. | 5 | 1 | 9 | Yes |
nodeType | Return the type of the node. | 5 | 1 | 9 | Yes |
nodeValue | Set or return the value of the node based on its type. | 5 | 1 | 9 | Yes |
ownerDocument | Return the root element (document object) that the attribute belongs to. | 5 | 1 | 9 | Yes |
ownerElement | Return the element node that the attribute is attached to. | No | 1 | 9 | Yes |
prefix | Set or return the namespace prefix of the attribute. | No | 1 | 9 | Yes |
schemaTypeInfo | 返回与属性相关联的类型信息。 | No | No | No | Yes |
specified | 如果属性值被设置在文档中,则返回 true,如果其默认值被设置在 DTD/Schema 中,则返回 false。 | 5 | 1 | 9 | Yes |
textContent | 设置或返回属性的文本内容。 | No | 1 | 9 | Yes |
text | 返回属性的文本。IE-only。 | 5 | No | No | No |
value | 设置或返回属性的值。 | 5 | 1 | 9 | Yes |
xml | 返回属性的 XML。IE-only。 | 5 | No | No | No |
- 上一页 DOM 节点类型
- 下一页 DOM CDATASection