Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1276 How can I read the text written in one frame by clicking a button on the other frame?

You are here: irt.org | FAQ | DHTML | Q1276 [ previous next ]

This is only possible using Internet Explorer 4+, and only where both frames are from the same server:

<script language="JavaScript"><!--
function getText()
    if (document.all) {
        for (var i=0;i < parent.otherFrameName.document.all.length; i++)
            if (parent.otherFrameName.document.all(i).tagName == 'BODY')
                alert(parent.otherFrameName.document.all(i).innerText);
            }
        }
    }
}
//--></script>

<form>
<input type="button" onClick="getText()" value="Get Text From Other Frame">
</form>

Feedback on 'Q1276 How can I read the text written in one frame by clicking a button on the other frame?'

©2018 Martin Webb