samdo,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.tabcontent {
display: none;
}
.tabcontent.show {
display: block;
}
</style>
</head>
<body>
<div>
<div id="tv1" class="tabcontent">1
<img src="./img/img1.jpg" alt="">
<img src="./img/img2.jpg" alt="">
</div>
<div id="tv2" class="tabcontent">2
<img src="./img/img3.jpg" alt="">
<img src="./img/img4.jpg" alt="">
</div>
<div id="tv3" class="tabcontent">3
<img src="./img/img5.jpg" alt="">
<img src="./img/img6.jpg" alt="">
</div>
</div>
<script>
var slideShow = function(container) {
this.images = container;
this.curImage = this.images.length - 1;
var nextSlide = function() {
this.images[this.curImage].classList.remove("show");
this.curImage = ++this.curImage % this.images.length;
this.images[this.curImage].classList.add("show");
window.setTimeout(nextSlide.bind(this), 5000);
};
nextSlide.call(this);
};
var slike = document.querySelectorAll("#tv1, #tv2, #tv3");
slideShow(slike);
</script>
</body>
</html>