JSFiddle - React, Tailwind, and code Playground

HTML

<img src="http://oi59.tinypic.com/245wk5h.jpg" class="js-image-swap" />

CSS

.js-image-swap {
    width:500px;
    height:500px;
}

JavaScript

(function() {
    var imgs = [
            "http://oi57.tinypic.com/245njlt.jpg",
            "http://oi59.tinypic.com/245wk5h.jpg"
        ],
        img = document.querySelector(".js-image-swap"),
        counter = 0;
    
    setInterval(function() {        
        img.setAttribute("src", imgs[counter]);
        counter = (counter === imgs.length-1) ? 0 : counter+1;
    }, 10000);   
    
})();