Make the draggable elements work as sortable
<p>Hello this is my code: </p>

<pre><code>$('.divex').draggable({ containment: 'document', revert: true, 
            start: function(){
                 contents = $(this);
                }
            });
$('.divex').droppable({ hoverClass: 'border', accept: 'div',
            drop: function(){
                     $('.divex')."WHAT FUNCTION TO CALL HERE"(contents + '&lt;br /&gt;');
                     }
        });
</code></pre>

<p>I want all my appended divs to be draggable and droppable.... more like sortables(but that doesn't work.)   </p>

<pre><code>var textArea = "&lt;div class='divex'&gt; &lt;textarea id='t"+counter+"'&gt;"+text+"&lt;/textarea&gt;&lt;button id='b"+  counter+"'name='t"+counter+"' &gt;edit&lt;/button&gt; &lt;button onClick='moveUp()' id='updiv'&gt;Up:&gt;&lt;/button&gt;&lt;/div&gt;"; 
</code></pre>

<p>this is the div that i've created dinamic! i just need the function to work, i've tried replaceWith() but that doesn't do the job.</p>
