HTML DOM isDefaultNamespace()Method

元素对象参考手册Element Object

Example

Check whether the defined namespace is the default namespace:

document.documentElement.isDefaultNamespace('http://www.w3.org/1999/xhtml');

Output result:

true

Try it Yourself »

Definition and Usage

If the specified namespace is the default, the isDefaultNamespace() method returns true, otherwise it returns false.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the isDefaultNamespace method.

Note:Internet Explorer 8 and earlier IE versions do not support this method.


Syntax

node.isDefaultNamespace(namespaceURI)

Parameters

Parameter Type Description
namespaceURI String Required. The namespace URI that you want to check.

Return Value

Type Description
Boolean Returns true if it is the default namespace, otherwise returns false.

Technical Details

DOM Version Core Level 3 Node Object


元素对象参考手册Element Object

Other Extensions