title: Why frameElement is null?
body: <p>I have problem with access to an iframe attribute from inside the iframe.</p>
  
  <p><img src="https://i.stack.imgur.com/Q6Hup.png" alt="HTML Structure"></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ins&gt;&lt;iframe scrolling="no" frameborder="0" width="728" height="90" style="border: 0px; overflow: hidden;"&gt;
      #document
   &lt;!DOCTYPE html&gt;
   &lt;html&gt;&lt;head&gt;&lt;base target="_top"&gt;&lt;/head&gt;
   &lt;body border="0" margin="0" style="margin: 0; padding: 0"&gt;
   &lt;iframe id="ra_frame" src="//banners.com/index.html" link="URL" style="width:728px!important; height:90px!important" ;="" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
   &lt;/body&gt;&lt;/html&gt;
  &lt;/iframe&gt;&lt;/ins&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I call frameElement iside the second iframe I get null.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.frameElement.getAttribute("link"); //Cannot read property 'getAttribute' of null</code></pre>
  </div>
  </div>
  </p>
  
  <p><img src="https://i.stack.imgur.com/rBRNq.png" alt="Console snapeshot"></p>
  
  <p>How can I get link attribute from inside the second iframe?</p>
  
  <p><strong>upd</strong>
  It's code from Revive Adserver, this iframes loading via JS. If load it in iframe manually all works fine.</p>
  
  <p><strong>upd</strong> One solution is add needed parameters to src get parameter.</p>