编辑下面的代码:【加编码】
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <body> <p id="demo">Click the button get the URI of the document's namespace</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x=document.getElementById("demo"); x.innerHTML=document.documentElement.namespaceURI; } </script> <p><strong>Note:</strong> Internet Explorer 8 and earlier does not support the namespaceURI property.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂