How to get html of en element and add to a td element
I am using jquery to do drag and drop. I am able to do drag and drop. My dragged element is an image. Now, I want to show this image on target which is a table cell(td). Ho开发者_如何学Pythonw to do this?
$(".emptyimg").draggable();
$("#tdcell").droppable({
drop: function(event, ui ) {$(ui.draggable).??;}
});
thanks
Check the following code:
<style>
#draggable { width: 150px; height: 150px; padding: 0.5em; }
</style>
<script>
$(function () {
$("#draggable").draggable();
});
</script>
<div class="demo">
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
<div id="draggable" class="ui-widget-content" style="cursor:move">
<p>Drag me around</p>
</div>
</div><!-- End demo -->
精彩评论