I have a number of variables which are assigned to div id's, and I want to loop through them. At the moment I can't pass the right value to the variable:

```
var video0, video1, video2;
video0 = '#div0';
video1 = '#div1';
video2 = '#div2';

for (i = 0; i <= 3; i ++) {
  $(video+i).click(function(){
      setupVideo(i);
  });
}

// Play each of the videos.
function setupVideo(index) {
  videoCount = index;
  playVideos(videoCount);
}

```

I know my problem lies in

```
$(video+i).click(function(){...

```

I've tried various methods of passing i to the video variables.