Please help me fix this code

HTML

```
<p class="imgclass">Test1</p>
<p class="imgclass">Test2</p>
<p class="imgclass">Test3</p>

```

JavaScript

```
imgclassElements = document.getElementsByClassName('imgclass');
for (var i = 0; i < imgclassElements.length; i++){
    imgclassElements[i].onmouseover=function(){alert(i);};
}

```

In browser `onmouseover` elements with class `.imgclass` appear alertbox only with text "3". How fix this? I want to pop-up alert window with values appropriate `.imgclass` elements order.