title: Javascript: get iframe id within loaded page
body: <p>I've got a page that has an iframe. Every time the page loads, iframe gets unique id and name assigned to it. I can get the iframe name within loaded iframe like so:</p>
  
  <pre><code>alert(parent.window.frames[window.name].name);
  </code></pre>
  
  <p>But when i try to get the id value:</p>
  
  <pre><code>alert(parent.window.frames[window.name].id);
  </code></pre>
  
  <p>I get <code>undefined</code>?</p>
  
  <p>Is it possible to get the id attribute of the iframe within loaded page?</p>
  
  <hr>
  
  <p><a href="http://jsfiddle.net/cqFtB/" rel="noreferrer">http://jsfiddle.net/cqFtB/</a></p>
  
  <hr>
  
  <pre><code>&lt;iframe id="lyygi8stwZSANUEh" src="http://example.com" name="zma82vRVe18xbAqW" title="Awesome Iframe"&gt;
  </code></pre>
  
  <p>example.com:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Awesome Iframe&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script type="text/javascript"&gt; 
          alert(parent.window.frames[window.name].name);
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>