.load() and .clone() doesn't work together
Hello I would like to clone an image which is loaded with Ajax, here is my HTML code :
- <div id="mydiv1"> </div>
<div id="mydiv2"> </div>
And here is my Javascript code :
- $( "#mydiv1" ).load( "/myimages.html" );
$( "#mydiv1 img" ).click( function () {
$( "#mydiv2 img" ).remove();
$( this ).clone().appendTo( "#mydiv2" );
});
But nothing happens, any ideas ? Thank you !