W3C standards tell us that the document object can be returned through the contentDocument attribute of the Dom object.
That is,
doc= document.getElementById('myframe ' ).contentDocument
But for IE browser, after testing, IE6 and IE7 are not supported, and IE8 starts to support it.
Under IE, you need to access
document .frames['myframe'].document;
The cross-browser solution is the
contentWindow property, which is a read-only property that returns the window object of the specified iframe.
Although it is not part of the standard, it is supported by all major browsers.
So the method to access the iframe document object across browsers is
document.getElementById( 'myframe').contentWindow.document