Hello,
I found a function called fnGetSibling
on
https://msdn.microsoft.com/en-us/library/ms533043(v=vs.85).aspx#navigate
and I was hoping to understand what it does return and why.
var oPrevious = fnGetSibling();
function fnGetSibling(){
var oParent=oNode.parentElement;
var iLength=oParent.children.length;
for(var i=0;i < iLength;i++){
if(oParent.children[i]==oNode){
return oParent.children[i - 1];
break;
}
}
}
I have three possible options:
1. Finds and returns a reference to all childs of a node of DOM Tree.
2. Finds and returns a reference to one of the children of a node of DOM Tree.
3. Finds and returns a reference to a father of a node of DOM Tree.
You are not solving any homework (it's summer), it's just from a quiz.