title: How parent frame access child frame window?
body: <p><strong>In the below code:</strong></p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html lang="en"&gt;
        &lt;head&gt;
          &lt;meta charset="utf-8"&gt;    
        &lt;/head&gt;
        &lt;body&gt;
  
          &lt;iframe srcdoc="&lt;script&gt;
                              window.innerStr='xyz';
                          &lt;/script&gt;" &gt;
          &lt;/iframe&gt;
  
          &lt;script&gt;
  
              function test() {
                  let iframe = window.frames[0];
                  console.log('frames innerStr: ' + iframe.innerStr); // does not work if child frame says innerStr = 'xyz' without window scope
              }
              window.onload = test;  
              test();
          &lt;/script&gt;
        &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  
  
  <p>For <code>window.innerStr='xyz';</code>, without using <code>window</code> scope in child frame, parent frame could not access child frame property(<code>innerStr</code>)</p>
  
  <p>Is window scoping mandatory for JS coding? <code>window.open('file.html')</code> has similar results.</p>