setAttributeNodeNS
setAttributeNodeNS adds a new attribute node with the specified namespace and name.
Syntax
replaced_attr = element.setAttributeNodeNS(namespace, attribute)Parameters
namespace is the namespace of the attribute as a string.
attribute is a node of type Attribute.
replaced_attr is the replaced attribute node, if any, returned by this function.
Example
Notes
If the attribute named already exists on the element, then that attribute is replaced with the new one and the replaced one is returned. The corresponding getter method for namespaced attribute nodes is getAttributeNodeNS.
Note that this function does not the set the value of the new attribute, only creates it on the element. Use setAttributeNS to set or change the value on an existing node within a particular namespace.
Specification
setAttributeNodeNS
Netscape Communications http://developer.netscape.com |