title: Javascript - Insert element at script position
body: <p>How do I insert element at script location (not to rely on div's id or class), for example</p>
  
  <pre><code>&lt;div class="div"&gt;
      &lt;script src='//remotehost/js/addDivSayHello.js'&gt;&lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>where <code>addDivSayHello.js</code> will insert div child <code>&lt;div&gt;hello&lt;/div&gt;</code>, result example:</p>
  
  <pre><code>&lt;div class="div"&gt;
      &lt;div&gt;hello&lt;/div&gt;
      &lt;script src='//remotehost/js/addDivSayHello.js'&gt;&lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried searching inside Stackoverflow but found nothing.</p>