title: How to add value from a iframe using javascript?
body: <p>I have a sample code:
  in index.html</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;  
  &lt;html xmlns:fb="http://ogp.me/ns/fb#"&gt;
  &lt;head&gt;  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;  
  &lt;title&gt;index&lt;/title&gt;  
  &lt;/head&gt;  
  &lt;body&gt;
  &lt;input type="text" value="" name="test" id="text_input"&gt;
  &lt;iframe src="iframe.html"&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>And iframe.html</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;  
  &lt;html xmlns:fb="http://ogp.me/ns/fb#"&gt;
  &lt;head&gt;  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;  
  &lt;title&gt;iframe&lt;/title&gt;  
  &lt;script&gt;
  function getValue(text) {
      document.getElementById('text_input').value = text;
  }
  &lt;/script&gt;
  &lt;/head&gt;  
  &lt;body&gt;
  &lt;a href="#" onclick="getValue('test');"&gt;Click&lt;/a&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>When click on a tag, value "text" can not be passed on <code>from iframe to index.html</code>, how to fix it ?</p>