This my code:
<div class="container">
<div class="prova">1</div>
<div class="prova">2</div>
<div class="prova">3</div>
</div>
I want to get every 500ms the content of each div. When I reach the 3rd position, return to the first one, and so on. A circular next()
.
Tried with:
var primoElem = $('.prova').first();
setInterval(function () {
console.log(primoElem.html());
primoElem = primoElem.next();
}, 500);
but I get only 3 results, then it stops.