Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | DHTML | Q1276 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.