how to add mouse event to div

how to add mouse event to div

Here I am able to see the thumbnails but mouseEvent not working, I need when user clicks on thumbnail it shows output a jpg name which is dynamically passed to div.

$(document).ready(function(){
    for(i=1;i<19;i++){
        $("#scroller").append("<div class='childDiv' div='child'"+i+"><img src='thumb/"+i+".jpg'></div>");
        $mydiv=$('#child'+i);
        $mydiv.myimage='images/'+i+'.jpg';
        $mydiv.click(function(){
            alert('clicked on thumbmail >>'+this.myimage);
        });
    }
})


this must show alert while click on div, but nothing happen. :(