<?xml version="1.0" encoding="gb2312" standalone="yes"?>
<html xmlns:mine="html">
<head>
<script>
function getElement(){
obj = document.getElementById('test');
alert(obj.childNodes[0].nodeValue);
}
</script>
</head>
<body>
<mine:tag id="test">hello world!</mine:tag><br>
<button onclick="getElement();">test</button>
</body>
</html>
<html xmlns:mine="html">
<head>
<script>
function getElement(){
obj = document.getElementById('test');
alert(obj.childNodes[0].nodeValue);
}
</script>
</head>
<body>
<mine:tag id="test">hello world!</mine:tag><br>
<button onclick="getElement();">test</button>
</body>
</html>
不过关键是标记没有ID属性,无法用getElementById方法,再次求解,谢谢!