|
| description: |
Adds a new attribute.
|
| parameters: |
| DOMString value |
- |
Value to set in string form.
|
|
| exceptions: |
| DOMException NO_MODIFICATION_ALLOWED_ERR
|
- |
Raised if this node is readonly.
|
| DOMException NAMESPACE_ERR
|
- |
Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace", or if the qualifiedName is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/".
|
|
| note: |
If an attribute with the same local name and namespace URI is already present on the element, its prefix is changed to be the prefix part of the qualifiedName, and its value is changed to be the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized
as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is
written out. In order to assign an attribute value that contains entity references, the user must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use setAttributeNodeNS or setAttributeNode to assign it as the value of an attribute.
|
|