title: How do I access different iframes?
body: <p>I am working with a website that uses different iframes on the same webpage. I am wondering how I can access and manipulate an iframe that I am not currently focused in on.</p>
  
  <p>The website has a body that allows users to type in, and I want to use the method innerHTML (javascript) to set the value of text in the box. However, I'm having trouble accessing the iframe.</p>
  
  <p>Here is the Javascript that I was trying to use, but it wasn't working as I intended.. getElementById is not a function of getElementsByTagName("iframe")</p>
  
  <pre><code>document.getElementsByTagName("iframe")[1].getElementById("tinymce").innerHTML="Hello, world!"
  </code></pre>
  
  <p>Here are the two iframes that I am working with:
  <a href="https://i.stack.imgur.com/YjPNI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YjPNI.png" alt="iframes"></a>
  I cannot inspect the page and change the iframe by hand, so that is not an answer I am looking for. Thank you for clearing things up for me!</p>
  
  <p>EDIT:
  As suggested, I try</p>
  
  <pre><code>document.getElementsByTagName("iframe")[1].document.getElementById("tinymce").innerHTML="Hello, world!"
  </code></pre>
  
  <p>However, I am still receiving an uncaught type error</p>