I have a element as below inside the document, I could get the iframe element by document.getElementById('iframe_id')
, but how to get the element inside this iframe? I tried iframeElement.contentWindow
, and the returned DOMWindow
has no properties. Also tried iframeElement.docuemnt
and iframeElement.contentDocument
, both of them are undefined. How can I get it? I am using the latest Chrome in my experiment.
Here is the iframe element
<iframe id='iframe_id'>
<html>
<body>many content here</body>
</html>
</iframe>