Availability
DOM Level 2 Core
Synopsis
void setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
throws DOMException;
Arguments
namespaceURI
The URI that uniquely identifies the namespace of the attribute to be
set or created, or null for no namespace.
qualifiedName
The name of the attribute, specified as a namespace prefix followed
by a colon and a name within the namespace.
value
The new value of the attribute.
Throws
This method may throw a DOMException with the following
code values:
INVALID_CHARACTER_ERR
The qualifiedName argument contains a
character that is not allowed in HTML or XML attribute names.
NAMESPACE_ERR
qualifiedName is malformed, or there is a
mismatch between the namespace prefix of
qualifiedName and the
namespaceURI argument.
NO_MODIFICATION_ALLOWED_ERR
This element is read-only and does not allow modifications to its
attributes.
NOT_SUPPORTED_ERR
The DOM implementation does not support XML documents.
Description
This method is like setAttribute( ), except that
the attribute to be created or set is specified by a namespace URI
and a qualified name that consists of a namespace prefix, a colon,
and a local name within the namespace. In addition to letting you
change the value of an attribute, this method allows you to change
the namespace prefix of an attribute.
This method is useful only with XML documents that use namespaces. It
may be unimplemented (i.e., throw a
NOT_SUPPORTED_ERR) on browsers that do not support
XML documents.
See Also
Element.setAttribute( ), Element.setAttributeNode( )
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.