I am trying to get into JQuery but am struggling a bit around.
What I'm trying to do is go through an array one click at a time so that each time I click on the "next" button a new item is presented.
Let's take a look at the following code:
$(document).ready(function(){
var stuff =["house","garden","sea","cat"];
for (var i=0; i<stuff.length;i++)
{
console.log(stuff[i]);
}
});
Now how I was thinking something like creating a while loop with i
$("#next").on('click', function(){i++;});
But this somehow doesn't work. Anyone able to explain to me how to do this in a relatively simple way?