I am trying to make a draggable image that only appears once a button is clicked. I have searched the web and I don't see what the problem is. This is the code
<script>
$(document).ready(function(){
$("#button1").click(function(){
$("#a").prepend('<img src="img.png">');
});
});
</script>
<button id="button1">Image</button>
<br>
<p id="a">
</p>