title: javascript - get data from an element within an iframe
body: <p>I've got this <code>&lt;iFrame&gt;</code> [name="data"] with a page displaying a <code>&lt;span&gt;</code>, with id="weergave_percentage".
  I want to get the numbers from that span into a javascript function.
  I currently made this, but it returns: null</p>
  
  <pre><code>var percentage = window.frames['data'].document.getElementById('weergave_percentage');
  alert(percentage);
  </code></pre>
  
  <p>What am I doing wrong and how can I do what I want?</p>
  
  <p>Note: the span containing the data, only contains numbers (float), and no other HTML formatting of any kind.
  Also, I've put the piece of javascript after the code for the iFrame, to make sure the iFrame is loaded when I try to get the data from the iFrame.
  Also, the iFrame's src is on the same domain as the main page.</p>