If the content of the iframe and its parent have the same domain, you can access the parent pages DOM from the iframe by using parent.document.getElement...
.
However you can’t do this cross-domain (not even across different subdomains) as it will result in:
Uncaught DOMException: Blocked a frame with origin "https://example.com" from accessing a cross-origin frame.