代码如下:
function GetIdListBySubKey(container,subKey,TagName)
{
var idList = "";
for(var i = 0; i
if(container.childNodes[i].nodeName == TagName && container.childNodes[i].id.indexOf(subKey) > -1)
{
idList += container.childNodes[i].id + ",";
}
if(container.childNodes[i].childNodes.length > 0)
{
idList += GetIdListBySubKey(container.childNodes[i],subKey,TagName)
}
}
return idList;
}
代码如下:
function GetIdListBySubKey(container,subIdKey)
{
var idList = "";
for(var i = 0; i
if(container.childNodes[i].attributes != null && container.childNodes[i].attributes["id"] != undefined && container.childNodes[i].id.indexOf(subIdKey) > -1)
{
idList += container.childNodes[i].id + ",";
}
if(container.childNodes[i].childNodes.length > 0)
{
idList += GetIdListBySubKey(container.childNodes[i],subIdKey)
}
}
return idList;
}
代码如下:
function GetConListBySubKey(container,subIdKey)
{
var reCOnArry= [];
for(var i = 0; i
if(container.childNodes[i].attributes != null && container.childNodes[i].attributes["id"] != undefined && container.childNodes[i].id.indexOf(subIdKey) > -1)
{
reConArry.push(container.childNodes[i]);
}
if(container.childNodes[i].childNodes.length > 0)
{
var re = GetConListBySubKey(container.childNodes[i],subIdKey)
for(var k = 0;k
reConArry.push(re[k]);
}
}
}
return reConArry;
}