.load() using load then applying actions to classes from the loaded content

.load() using load then applying actions to classes from the loaded content

Hi,

I have a question about load().  I created a php script that simply returns <img src="something.jpg" class="myimage">

To test I created this code, the image loads fine and the mouseover works fine showing the alert dialog :

         $('#mydiv').load('myfile.php');
         
          $('#mydiv').mouseover(function(){
             alert('TEST');
          })

However, my trouble seems to be that if I bind  mouseover to the class "myimage" nothing happens, like so :

      $('#mydiv').load('myfile.php');

       $('.myimage').mouseover(function(){
             alert('TEST');
          })


Could someone help me understand what I'm missing? Seems that the document would load the html first then the mouseover bound to the class (myimage) would fire off.

thanks