L
lopi
Hi, I'm trying to add the method nextSibling to a HTMLElement such as
a DIV in the body of a html document.
Once the function nextSibling was defined
function sibling () {
return( document.all[this.children.length+1] );
}
I tried to add the method by the following instruction
HTMLElement.prototype.nextSibling=sibling;
but it seems it does not work. Probably the class has to be named
somehow else. Who knows a complete list of classes/object?
Can anyone help? TIA
a DIV in the body of a html document.
Once the function nextSibling was defined
function sibling () {
return( document.all[this.children.length+1] );
}
I tried to add the method by the following instruction
HTMLElement.prototype.nextSibling=sibling;
but it seems it does not work. Probably the class has to be named
somehow else. Who knows a complete list of classes/object?
Can anyone help? TIA