There is a native "nextSibling" attribute,but how to get "lastSibling"?
Maybe:
Node.parentNode.lastChild
Hope this helps!
A Few functions to handle DOM events
from the article
function lastSibling(node){
var tempObj=node.parentNode.lastChild;
while(tempObj.nodeType!=1 && tempObj.previousSibling!=null){
tempObj=tempObj.previousSibling;
}
return (tempObj.nodeType==1)?tempObj:false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With