Why not use jQuery? You won't have to walk the entire DOM. You just specify the object ID and jQuery finds it for you.
>I use this to create a div element in a window:
>
>
>loDiv=window.parent.document.createElement("div")
>window.parent.document.body.appendChild(loDiv)
>
>
>Now, later down the code, I need to remove the div.
>
>So, I need to use something like this:
>
>
>document.body.removeChild(loDiv)
>
>
>But, this is not totally the right syntax as loDiv has been created in an IFrame inside the main window. The main window do have a variable available such as:
>
>
>loDiv=""
>
>
>So, I guess, once the appendChild() is done, I need to assign that loDiv to the loDiv of the main window. I am not sure about the proper syntax however.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer