since the image is loaded dynamicly,you should use the jquery.listen plugin.
It will allow you to 'listen' for the element and attach a click event to the newly created image. $('#mydiv').listen( 'click', 'img.myimgclass', function(){ //My code to run }); On Thu, Jul 10, 2008 at 7:30 AM, Topayung, Amdys Max <[EMAIL PROTECTED]> wrote: > Hi,, > > This is what i change so far.. But it always execute the alert each time > the image is loading. > > $.fn.image = function(src, f){ > return this.each(function(){ > var i = new Image(); > i.src = src; > i.onload = f; > *i.onclick = alert(c);* > this.appendChild(i); > }); > } > > $("#thumbnail").image(returData[0],*"satu"*,function(){}); > > Thanks.. > Regards. > Amdys > -- Robert Benchley - "Drawing on my fine command of the English language, I said nothing."