title: Get an element in an <embed> tag
body: <p>I'm a beginner in Javascript and i'm trying to get an element from an embed tag. This embed tag contains a pdf.
  I want to get the button "next page" from the pdf viewer, and simulate a click on it, in order to automaticly scroll to the next page of the pdf.</p>
  
  <p>My HTML code is something like this (really simplified) :</p>
  
  <pre><code>&lt;html&gt;
    &lt;body&gt;
      &lt;div id="display-zone"&gt;
        &lt;embed id="myPdf" src="./myPdf.pdf"&gt;
          #document
            &lt;html&gt;
              &lt;body&gt;
                &lt;!-- The button I want to get in my JavaScript --&gt;
                &lt;button id="next" class="toolbarButton pageDown"&gt;&lt;/button&gt;
              &lt;/body&gt;
            &lt;/html&gt;
          &lt;/embed&gt;
        &lt;/div&gt;
      &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>
  
  <p>My JS code to print the pdf viewer on the web page :</p>
  
  <pre><code>affichage.innerHTML = "&lt;embed class=\"media\" id=\""+ongletsMedias[i].firstChild.data+"\" src= \""+ongletsMedias[i].firstChild.data+"\" width= \"1000\" height= \"800\"&gt;";
          // ongletsMedias[i].firstChild.data equals to "myPdf"
          t = 5000; // time before starting pdfDefile()
          setTimeout(pdfDefile,t,ongletsMedias[i].firstChild.data,i,1); //call the function to scroll pdf pages
  </code></pre>
  
  <p>And finally my function <code>pdfDefile()</code> that I'm calling in order to scroll the pdf pages :</p>
  
  <pre><code>function pdfDefile(dir,i,page) {
  var xhttp = new XMLHttpRequest();
  var t = 0;
  xhttp.onreadystatechange = function() {
    var checkbox = document.getElementById('checkbox');
    if (this.readyState == 4 &amp;&amp; this.status == 200 &amp;&amp; checkbox.checked) {
      document.getElementById("span").innerHTML = this.responseText; // display the number of pages of my pdf
      var t = 5000;
      if (page &lt; parseInt(this.responseText)) { //test for recursive call
        /*HERE is where I want to get the "next" button */
        setTimeout(pdfDefile,t,dir,i,page+1);// recall this function while there is a next page to display
      } else {
        setTimeout(jouerMedia,t,i+1);// call the main fuction, no problem here
      }
    }
  };
  xhttp.open("GET", "nbPagesPDF.php?pages="+dir, true);
  xhttp.send();
  </code></pre>
  
  <p>}</p>
  
  <p>I already look at an existing topic (<a href="https://stackoverflow.com/questions/24280414/get-element-in-embed-tag">Get element in embed tag</a>), but I can't make it work in my JS.</p>
  
  <p>So please, can you help me to make my code great again (may it have been ;-) ) ? </p>
  
  <p>Regards</p>