I have the following script which changes the image being displayed based on a timer
<img id="image" src="image1.png">
<script type = "text/javascript">
var image = document.getElementById("image");
var currentPos = 0;
var images = ["image1.png","image2.png","image3.png"]
function volgendefoto() {
if (++currentPos >= images.length)
currentPos = 0;
image.src = images[currentPos];
}
setInterval(volgendefoto, 3000);
</script>
I want to apply this script to my websites background Image that I implement use CSS to allow the background Image to change WITHOUT Jquery
body{
background-image: url("https://images.pexels.com/photos/260352/pexels-photo-260352.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260");
background-repeat: repeat;
font-family:monospace;
}