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

  • Home
  • SEARCH
  • 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 8905919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:31:01+00:00 2026-06-15T02:31:01+00:00

I have a sample code: in index.html <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

  • 0

I have a sample code:
in index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>index</title>  
</head>  
<body>
<input type="text" value="" name="test" id="text_input">
<iframe src="iframe.html">
</body> 
</html>

And iframe.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>iframe</title>  
<script>
function getValue(text) {
    document.getElementById('text_input').value = text;
}
</script>
</head>  
<body>
<a href="#" onclick="getValue('test');">Click</a>
</body> 
</html>

When click on a tag, value “text” can not be passed on from iframe to index.html, how to fix it ?

  • 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-15T02:31:02+00:00Added an answer on June 15, 2026 at 2:31 am

    Use parent to get parent window of iframe. Try this

    function getValue(text) {
        parent.document.getElementById('text_input').value = text;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Text and sample code adapted from http://www.webdeveloper.com/forum/archive/index.php/t-65078.html , may not reflect actual question: I
I have downloaded the sample code from this site for FTP Client http://www.lysesoft.com/products/andftp/index.html But
i execute this sample code in android3.0 http://developer.android.com/resources/samples/BluetoothChat/res/index.html Bluetooth Chat <!-- BluetoothChat --> <string
I am studying the LunarLander example in the Android sample code: http://developer.android.com/resources/samples/LunarLander/index.html I am
I have this sample code for async operations (copied from the interwebs) public class
I have this simple code that append a div inside the body, <!DOCTYPE html>
I have just downloaded the DynamicReports libraries from http://dynamicreports.sourceforge.net/index.html . I'm currently using a
I'm trying to test out a sample code from the CUDA site http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#kernels .
I have tried a websocket sample code as below, my browser is supporting HTML
I have this simple code in my user_controller.rb file #listing all users def index

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.