JSFiddle - React, Tailwind, and code Playground

HTML

<h1>
This is a heading
</h1>

JavaScript

images = ['http://www.crystalinks.com/ColosseumNight2.jpg', 'http://www.bbc.co.uk/staticarchive/ad9551bff84a180765acffd1c7e3710da1f775b9.jpg', 'http://theplanetd.com/images/Pantheon-rome-italy-1-XL.jpg', 'https://cdn.theatlantic.com/assets/media/img/mt/2016/03/42_39239791/lead_960.jpg?1459187615', 'http://historylearning.com/fileadmin/_processed_/csm_Colosseum-in-Ancient-Rome_0905837084.jpg'];

document.body.style.backgroundImage = "url('http://www.crystalinks.com/ColosseumNight2.jpg')";
document.body.style.backgroundSize = "contain";

var index = 0;
function changeImage() {
    document.body.style.backgroundImage = "url(" + images[index] + ")";
    if (index < 4) {
    		index++;
    }
    else {
    		index = 0;
    }
}

setInterval(changeImage, 2000);