What exactly does “contentDocument” represent for an iframe (or even the old “frame” element)? Is it equivalent to the “html” element or the “body” element ?
What is it’s use?
And is this property supported across all the browsers?
What exactly does contentDocument represent for an iframe (or even the old frame element)?
Share
w3.org
MDN
msdn
So to get the innerHTML of the body element you could use
iframe.contentDocument.getElementsByTagName("body")[0]or
iframe.contentDocument.bodyin todays browsers.