Auto open active links in div on new tab
<p>Been trying to automatically open active links in a div on a new tab when page is loaded</p>

<p>I can't edit the links to add ids or classes, it would have been much easier this way:</p>

<pre><code>  document.getElementById('yourLinkID').click();
</code></pre>

<p>if I could add ids to the links but am not allowed to.</p>

<p>On the page I have</p>

<pre><code> &lt;div id="boss" class="boss"&gt;
 &lt;a href="http://example.com" title="Example.com"&gt;Example.com&lt;/a&gt;
 &lt;a href="http://example.com" title="Example.com"&gt;Example.com&lt;/a&gt;
 &lt;a href="http://example.com" title="Example.com"&gt;Example.com&lt;/a&gt;
 &lt;a href="http://example.com" title="Example.com"&gt;Example.com&lt;/a&gt;
 &lt;/div&gt;
</code></pre>

<p>This would do it in JQuery, </p>

<pre><code>$(function(){
  $("#myDiv a").attr("target","_blank");
});
</code></pre>

<p>Any help with this in JavaScript? A working JS fiddle would be appreciated.</p>