isDefaultNamespace
Summary
Indicates whether or not a namespace is the default namespace for a document.
Syntax
var isDefault = node.isDefaultNamespace(/* see parameter list */);
Parameters
namespace
- Data-type
- String
The namespace to be compared to the default namespace.
Return Value
Returns an object of type BooleanBoolean
Whether the namespace specified in the namespace parameter is the default namespace for the document.
Examples
The 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"></script>
</body>
</html>
Related specifications
- DOM Level 3 Core
- Recommendation
Attributions
Mozilla Developer Network : [Node.isDefaultNamespace Article]
Microsoft Developer Network: [isDefaultNamespace Method Article]