The Window.frameElement property returns the element (such as or ) in which the window is embedded.
Window.frameElement
MDN Reference