title: Opening ten random images in new tabs
body: <p>There is a link that opens a random image from unsplash. Here it is: <a href="https://source.unsplash.com/random/1920x1080" rel="nofollow noreferrer">https://source.unsplash.com/random/1920x1080</a></p>
  <p>I intend to open ten tabs with random images. Here is my code:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
  &lt;meta charset=&quot;UTF-7&quot;&gt;
  &lt;style&gt;
    body{margin:0px;color:#252430;background-color:#fff}
    p{margin-top: 10em; font-size: 2em;}
  &lt;/style&gt;
  &lt;script&gt;
  function openitall(){
               var i;
               for(i=1;i&lt;=10;i++){
                            window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;,&quot;_blank&quot;);
               }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload=&quot;openitall()&quot;&gt;
  
  &lt;p align=center&gt;I am a page opening ten random images in new tabs.&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>But that way I get ten <strong>same</strong> images. So I am thinking of a delay:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
  &lt;meta charset=&quot;UTF-7&quot;&gt;
  &lt;style&gt;
    body{margin:0px;color:#252430;background-color:#fff}
    p{margin-top: 10em; font-size: 2em;}
  &lt;/style&gt;
  &lt;script&gt;
  function openitall(){
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),3000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;,&quot;_blank&quot;),6000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),3000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),6000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),9000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),12000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),15000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),18000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),21000);
        setTimeout(window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;),24000);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload=&quot;openitall()&quot;&gt;
  
  &lt;p align=center&gt;I am a page opening ten random images in new tabs.&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>But that doesn't help either. All the tabs are immediately opened without any delay. Could you please help?</p>
  <p>EDIT: posting this:</p>
  <p>Here it is without the parenthesis:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
  &lt;meta charset=&quot;UTF-7&quot;&gt;
  
  &lt;style&gt;
    body{margin:0px;color:#252430;background-color:#fff}
    p{margin-top: 10em; font-size: 2em;}
  &lt;/style&gt;
  
  &lt;script&gt;
  function myOpen(){
    window.open(&quot;https://source.unsplash.com/random/1920x1080&quot;, &quot;_blank&quot;);
  }
  
  function openitall(){
      for(var i=1;i&lt;=10;i++){
          setTimeout(myOpen,5000);
      }  
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body onload=&quot;openitall()&quot;&gt;
  
  &lt;p align=center&gt;I am a page opening ten random images in new tabs.&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>And it still does not work..</p>