This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Node.prefix read-only property returns the namespace
prefix of the specified node, or
null if no prefix is specified.
string = node.prefix
The following logs "x" to the console.
This 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.
|Document Object Model (DOM) Level 3 Core Specification
The definition of 'Node.prefix' in that specification.
|Obsolete||Specifies the behavior when it's set to
|Document Object Model (DOM) Level 2 Core Specification
The definition of 'Initial definition' in that specification.
BCD tables only load in the browser