Optimal Method of Changing Order of Elements using jQuery
<p>Given the following:</p>

<pre><code>&lt;a id="moveElementUp"&gt;Move Up&lt;/a&gt;
&lt;a id="moveElementDown"&gt;Move Dowm&lt;/a&gt;

&lt;div id="elementHolder"&gt;
    &lt;a id="element-1"&gt;1&lt;/a&gt;
    &lt;a id="element-2"&gt;2&lt;/a&gt;
    &lt;a id="element-3"&gt;3&lt;/a&gt;
    &lt;a id="element-4"&gt;4&lt;/a&gt;
&lt;/div&gt;

&lt;script type="text/javascript"&gt;
    function reOrder (el){
        // Change IDs of Elements to be Sequential
    }
    $('#moveElementUp').click(function(e){
        // Move Clicked Element Up One Spot in List

        reOrder();
    });
    $('#moveElementDown').click(function(e){
        // Move Clicked Element Down One Spot in List

        reOrder();
    });
&lt;/script&gt;
</code></pre>

<p>What is the optimal (and fastest) way of going about changing the order of the elements and changing the IDs of all elements to maintain sequential order using jQuery?</p>

<p>Any help would be greatly appreciated!</p>
