I've been trying to get a NodeList from a parentNode chain array with the following code:
dojo.NodeList().adopt(getAncestry(searchNode))
…
function getAncestry(startNode){
var arr = [];
var n = startNode;
while(n = n.parentNode){
if(n.nodeName == 'BODY')break;
arr.push(n);
}
return arr;
}…but get a result of a NodeList which contains the ancestry node array in its first index. Ex:
dojo.NodeList().adopt(getAncestry(searchNode).forEach(function(item){
console.log("item : " + item)
})
