title: Access a variable of iframe from parent
body: <p>script of iframe</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
  var a=5;
  &lt;/script&gt;
  </code></pre>
  
  <p>script of parent window</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
  function close()
  {
  var check=document.getElementById("iframeid").contentDocument.a;
  alert(check)
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to access the variable which is defined inside the iframe from parent. But the above code doesn't work properly can anyone give an idea to implement this.</p>