How to access element values inside an iframe using Javascript?

Here’s another helpful post for beginners in how to access element values inside an iframe.

var txt = window.frames["iframeName"].document.forms["formName"].elements["elementName"].value;

Tip:  To avoid confusion, your page elements should have the same Id and Name.

I hope this helps!

Trackback URL

, ,

No Comments on "How to access element values inside an iframe using Javascript?"

Hi Stranger, leave a comment:

ALLOWED XHTML TAGS:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Subscribe to Comments