If you're desperate and it's cross-origin, you *could* try a proxy server to fetch the iframe content, but that's a whole other can of worms.
For same-origin, just make sure the iframe is loaded before you try to access it.
```js
iframe.onload = () => {
console.log(iframe.contentWindow.document);
};
```
But yeah, cross-origin = dead end.
For same-origin, just make sure the iframe is loaded before you try to access it.
```js
iframe.onload = () => {
console.log(iframe.contentWindow.document);
};
```
But yeah, cross-origin = dead end.
