A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/Node/isDefaultNamespace below:

isDefaultNamespace ยท WebPlatform Docs

isDefaultNamespace Summary

Indicates whether or not a namespace is the default namespace for a document.

Method of dom/Nodedom/Node

Syntax
var isDefault = node.isDefaultNamespace();
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">//<![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
DOM Level 3 Core
Recommendation
Attributions

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