```
<ul id="ulGall">
<li><img src="gaLL/red.jpg"/></li>
<li><img src="gaLL/blue.jpg"/></li>
<li><img src="gaLL/white.jpg"/></li>
<li><img src="gaLL/orange.jpg"/></li>
</ul>

```

.

```
$(document).ready(function() {
 x = 0;
 z = $('#ulGall li').length;
});  

```

.

```
$('#btnR').click(function() {
    if(x == z) {x = 1;} 
    else {x = x + 1;} // till here everything works  

    alert ($('ulGall').index =x, src attribute // just as description 

```

i.e. - give me img `src` attribute - where `li index = x`

So first click should be `gaLL/red.jpg`  

Next click - `gaLL/blue.jpg` and so on  

After orange - red again.