JSFiddle - React, Tailwind, and code Playground

HTML

<img src="https://www.google.com/images/srpr/logo3w.png" name="slide" id="slide" width="100" height="56" />

JavaScript

//variable that will increment through the images
var step = 1;

function slideit() {
    //if browser does not support the image object, exit.
    var img = document.getElementById('slide');
    img.src = "image" + step + ".src";
    console.log(img.src);
    if (step < 3) step++;
    else step = 1;
    //call function "slideit()" every 1.5 seconds
    setTimeout(slideit, 1500);
}
window.onload = slideit();