Automatic Slideshow on load
<p>I am trying to create a slideshow with an onload event through a separate JS file. I've tried looking for possible solutions online and all of them require the coding to be all in one file. What would be the best way to approach this issue?</p>

<p>I have attached my HTML coding for the JS reference.</p>

<pre><code>     &lt;div class="slideshow-container"&gt;
        &lt;div id="slideshow"&gt;
            &lt;div class="numbertext"&gt;1 / 5&lt;/div&gt;
            &lt;img src="images/LakeYellowstoneSunset.jpg" height="408px" width="616px"/&gt;
            &lt;div class="text"&gt;Yellowstone National Park&lt;div&gt;



            &lt;div class="numbertext"&gt;2 / 5&lt;/div&gt;
            &lt;img src="images/SanMural.jpg" width="408px" height="616px"/&gt;
            &lt;div class="text"&gt;San Francisco, CA&lt;/div&gt;



            &lt;div class="numbertext"&gt;3 / 5&lt;/div&gt;
            &lt;img src="images/SanJelly.jpg" height="408px" width="616px"/&gt;
            &lt;div class="text"&gt;San Francisco Aquarium&lt;/div&gt;



            &lt;div class="numbertext"&gt;4 / 5&lt;/div&gt;
            &lt;img src="images/AKGold.jpg" height="408px" width="616px"/&gt;
            &lt;div class="text"&gt;Alaska Yukon&lt;/div&gt;


            &lt;div class="numbertext"&gt;5 / 5&lt;/div&gt;
            &lt;img src="images/SaltLake.jpg" height="408px" width="616px"/&gt;
            &lt;div class="text"&gt;Salt Lake City, UT&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>