How to refer to the true 'body' of a page? [NOT iFrame body]
- by Jim
I have a script that create a new div element. Then, I want to append the div to the body of the page using appendChild method.
The script is look like this :
var div = document.createElement('div');
div.id = 'newdiv';
document.body.appendChild(div);
Unfortunately, the div also appended to the body of iframes. So, my question is, how to refer to the true body of the document, not including the body of the iframes? That way, the div just appended once, to the "true body" of the document. Thanks before, and sorry if my english is bad. :-D