if (window.parent.loDiv) { window.parent.loDiv.parentNode.removeChild(window.parent.loDiv) }Basically, the concept is to focus on using the actual point of reference, moving it to the parent, and it can then remove itself (its child), which is what we want.