Indicates whether or not a namespace is the default namespace for a document.
Syntaxvar isDefault = node.isDefaultNamespace();
Parameters namespace
The namespace to be compared to the default namespace.
Return ValueReturns an object of type BooleanBoolean
Whether the namespace specified in the namespace parameter is the default namespace for the document.
ExamplesThe following example compares the default Namespace of the body element to the SVG namespace and then to the xHTML namespace. false then true is displayed.
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>isDefaultNamespace example</title>
</head>
<body>
<script type="text/javascript">//<![CDATA[
var nsSVG='http://www.w3.org/2000/svg';
alert(document.body.isDefaultNamespace(nsSVG));
var nsxHTML='http://www.w3.org/1999/xhtml';
alert(document.body.isDefaultNamespace(nsxHTML));
//]]></script>
</body>
</html>
Related specifications
Mozilla Developer Network : [Node.isDefaultNamespace Article]
Microsoft Developer Network: [isDefaultNamespace Method Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4