Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8216035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:59:27+00:00 2026-06-07T11:59:27+00:00

Just wondering if it’s possible to change a label or element in a iframe

  • 0

Just wondering if it’s possible to change a label or element in a iframe from another iframe that are both loaded on the same page?

I have 2 iframes on a page:

<iframe id="leftMenu" src="menu.htm" STYLE="top:90px" NAME="menu" width="270px" frameborder="0"></iframe>

<iframe src="page.htm" STYLE="top:90px" NAME="AccessPage" width="100%" height="100%" frameborder="0"></iframe>

From page.htm (2nd iframe) I want to be able to change a value by an ID to something else on the 2nd iframe.

For Example:
menu.htm (1st iframe) has a label on that page..

<label id="test">test1234</label>

From the page.htm (2nd iframe) I want to change the value of that label.

I have tried doing the following but had no luck:

document.getElementById('leftMenu').contentWindow.document.getElementById('test').value = 'test successful';
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:59:30+00:00Added an answer on June 7, 2026 at 11:59 am

    Use window.parent like this:

        window.parent.document.getElementById('leftMenu').contentWindow.document.getElementById('test').innerHTML = "Replaced Successful!"
    

    And instead of .value use .innerHTML

    See a working DEMO: http://jsfiddle.net/rathoreahsan/G2un4/4/

    Tested locally and working fine also.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering is it possible to build CLI app that can be run from
just wondering whether it's possible to change the screen timeout using code in Android
Just wondering, will it be possible we can check whether the page is call
Just wondering if it's possible to apply a *.css to a spark TextArea? If
just wondering is there any chance that their will be a dummy database schemas
Just wondering how Cocos manages the CPU cycle and graphics engine for CCSprites that
Just wondering whether it is possible to convert highly normalized data into binary and
Just wondering how to set a hidden field value so that when I submit
Just wondering if what I want to do is possible with Solr: I have
Just wondering what it is that I am doing wrong here?? It's very simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.