First of all, the two documents - the iframe page and the page it's embedded in - must be from the same domain ("same origin policy"). If that's the case, you'll need to call DOM methods
inside the containing page
, not the iframe page. A document's DOM methods (like createElement) cannot be called to modify another document in another window. Would help to see some code ...
var d = parent.document.createElement('div');