Creating a draggable div using jquery
by Akram kamal
HTML
<button>
click
</button>
JavaScript
$(function() {
$( "input[type=submit], a, button" )
.button()
.click(function( ) {
$( "<div class='ui-widget-content'><p>Drag me around</p></div>" ).appendTo( "body" ).draggable();
});
});