Node.isDefaultNamespace()

The Node.isDefaultNamespace() method accepts a namespace URI as an argument and returns a boolean value that is true if the namespace is the default namespace on the given node and false if not.

Syntax

result = node.isDefaultNamespace(namespaceURI);

Parameters

namespaceURI is a string representing the namespace against which the element will be checked.

Return value

result is a boolean value that holds the return value true or false.

Example

var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var el = document.getElementsByTagNameNS(XULNS, 'textbox')[0];

alert(el.isDefaultNamespace(XULNS)); // true

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
isDefaultNamespace
1
12
1
9
≤12.1
3
1
18
4
≤12.1
1
1.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Node/isDefaultNamespace