You have two options really:
Window.top - Web APIs | MDN[
^]
Window.parent - Web APIs | MDN[
^]
window.top
refers to the absolute parent. This can be used from JS which has been nested multiple times to get the uppermost parent.
window.parent
refers to the direct parent of the current page. If nested multiple times then it'd be the one directly above, not necessarily equal to
window.top
You can use the query selector as usual:
window.top.document.querySelector()
Also, to follow up on what you posted, what is "txtfolio"? You used
querySelector()
to find "txtfolio" but that isn't a valid HTML element. If that's the name of the element then you should instead use
getElementsByName()[
^]