JSFiddle - React, Tailwind, and code Playground

HTML

<h1>Write a simple slideshow page</h1>
<p>A div with an id of 'slideshow' contains five images, the first is visiible and the others are hidden using a display style of none. Using JavaScript, create a simple slideshow that cycles through the images, displaying each one for three seconds at a time, looping back to the first image when the end is reached. You cannot use jQuery or any other library. Sample HTML is below. <strong>We do not expect this code to run.</strong></p>

<div id="slideshow">
    <div><img src="http://placehold.it/150x150"></div>
    <div><img src="http://placehold.it/150x150"></div>
    <div><img src="http://placehold.it/150x150"></div>
    <div><img src="http://placehold.it/150x150"></div>
    <div><img src="http://placehold.it/150x150"></div>
</div>