Related Post

6 Comments Received

June 6th, 2007 @11:01 am  

Hey this is just what I was looking for. Thanks :)

November 3rd, 2007 @7:13 am  

Thanks buddy…

I tried the code but to make it run I had to put 1 as String

function getNextSibling(startBrother){
endBrother=startBrother.nextSibling;
while(endBrother.nodeType!=”1″){
endBrother = endBrother.nextSibling;
}
return endBrother;
}

November 3rd, 2007 @7:14 am  

My Firefox version is 2.0.0.9

November 11th, 2007 @6:21 am  

the problem with this code starts when the
startBrother.nextSibling = empty space, which in ie you can check it with “if(startBrother.nextSibling)” but with firefox there’s a bit of complex.. didn’t find the answer yet…

May 26th, 2008 @4:18 am  

Just exploring some Javascript stuff. LOL, I accidently copied the code in comments, so it works. Same code works for previousSibling, only u have to chande the nextSibling to previousSibling. Great work!

Thanks.

October 27th, 2008 @9:42 pm  

so cool.. I like it. thanks.

Leave A Reply

Please Note: Comments maybe under moderation after you submit your comments so there is no need to resubmit your comment again