An external script certainly cannot access the DOM. That would be security nightmare.
As I mentioned, the HtmlComponent is a little more flexible, but it is sandboxed. That is, any DOM access in an HtmlComponent is restricted to only the code in the HtmlComponent. There is no way to access the parent’s DOM.