How to use document.querySelector in a forge Custom UI App?

I tried using document.querySelector in a forge App that is opening createIssueModal where I am trying to access the heading of the create Issue Modal. I get null always while the same querySelector is working fine in the browser console.

Custom UI apps work inside an iframe, so they don’t have access to the same document as the browser console.

Thanks @AaronCollier. That helps.