var frame = parent.document.getElementsByTagName("frame")[1]; var frameDocument = frame.contentDocument || frame.contentWindow.document; frameDocument.getElement…