var idlist; function GeSelectedNode() { var getAllNodes = ""; idlist = new Array(); //实例化数组 var tree = document.getElementById("treenameOrid").getElementsByTagName("input"); for (var i = 0; i < tree.length; i++) { if (tree[i].type == "checkbox" && tree[i].checked) { var s = tree[i].nextSibling.pathname; //要用此属性获取值,必须设置属性newNode.NavigateUrl = 需要的值; getAllNodes += s + '/'; idlist.push(s); //将值添加入数组最后一项; } } alert(tree.length); alert(getAllNodes); }