1
<p id="demo">单击按钮是否是指定默认名称空间</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var d = document.documentElement;
6
var x = document.getElementById("demo");
7
x.innerHTML = d.isDefaultNamespace("http://www.w3.org/1999/xhtml");
8
}
9
</script>
10
<p><strong>注意:</strong> Internet Explorer 8 及之前版本不支持isDefaultNamespace方法。</p>