I have a javascript code that have span tag and inside the span tag there is an image tag and normal text next to the image tag. I want to bind the click event on image tag but the event didn't fire at all. I use the jquery to accomplish this.
var a = new Image();
$(a).prop('src','blah');
$(a).load( blah);
$(span).append($(a));
$(a).click(function (e) { alert('asdf'); } );
not event if i do this
$(span).find($(a)).click( blah );
var button = $(this.imgClose).clone();
$(button).prop('id', 'close');
$(template).append($(button));
$(template).find('#close').on('click', '', function (event) { alert('sss'); });