...

View Full Version : appendChild



sitNsmile
01-20-2012, 05:45 AM
Hello,

If I have a <div id="mydiv"></div>
and I use


iframe = document.createElement("iframe");
document.getElementById("mydiv").appendChild(iframe)

Does the iframe append after </div> <iframe>
or does it append <div id="mydiv"> <iframe> </div>

Thanks

Old Pedant
01-20-2012, 06:22 AM
Did you try it, say with Firebug or another debugger present?

a *child* is indeed *INSIDE* the parent that appended it.

SO

<div id="mydiv">
<iframe />
</div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum