function createDragDrop() { $('.task').each(function() { this.Draggable({revert:true, ghosting:true, handle:this.id+'_move'}); }); }