Sets or retrieves the prefix of the fully qualified XML declaration for a node.
Note: This property is read-only.
var prefix = node.prefix;
Returns an object of type StringString
The prefix portion of the qualified name of the node.
This example will only work when a namespace-aware parser is used, i.e. when a document is served with an XML mime-type. This will not work for HTML documents.
In XML documents, elements can be declared using qualified names, which consist of a prefix and a localName. This property returns the former value.
For more information, see W3C Namespaces in XML.
Prior to Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), this property was read-write; the specification says it should be read only, and now it is.
- DOM Level 3 Core