首页 > 应用开发 > > javascript;dom的问题求解决
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Node节点对象练习2</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
北京
海淀
奥运
</body>
<script type="text/javascript">
//打印出 id=“bj” 该节点的所有子节点的(nodeName, nodeType, nodeValue)
//同时打印文本值 北京 海淀 奥运
</script>
</html>
这个问题怎么做,我的js代码
var a=document.getElementsByTagName("li");
for(var i=0;i
var aa=a[0].childNodes;
alert(aa[1].childNodes[0].nodesValue);
错的,而且没做完?求解决?
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1441/viewspace-3138760/ ,如需转载,请注明出处,否则将追究法律责任。