Javascript examples for DOM:Element isDefaultNamespace
The isDefaultNamespace() method returns true if the specified namespace is default, otherwise false.
Parameter | Type | Description |
---|---|---|
namespaceURI | String | Required. The URI of the namespace to check |
A Boolean, returns true if the namespace is default, otherwise false
The following code shows how to Find out if the defined namespace is the default namespace:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w w w. ja v a2 s . c o m*/ var d = document.documentElement; var x = d.isDefaultNamespace("http://www.w3.org/1999/xhtml"); document.getElementById("demo").innerHTML = x; } </script> </body> </html>