title: Fill a form from another website JS
body: <p>I would like to fill a form from another website, but I have an error and I don't understand why.</p>
  
  <p>My JS's Function : </p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
    function rempliFormulair(url) {
      var fenetrePopup = window.open(url);
   fenetrePopup.getElementsByName("NameText").value = "MyLogin";
      fenetrePopup.getElementsByName("NameForm").submit();
    }
  
    &lt;/script&gt;
  </code></pre>
  
  <p>There is my Form : 
  </p>
  
  <pre><code>&lt;form name = "NameForm" class="" action="index.html" method="post"&gt;
    &lt;input id = "idText" type="text" name="NameText" value=""&gt;
      &lt;input id = "azee" type="submit" name="submit" value="aze"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: fenetrePopup.getElementsByName is not a function at rempliFormulair</p>
  </blockquote>