jQuery swap div order
<p>I have a couple of divs that I want to be able to reorder by the use of buttons. These buttons would be called "move up" and "move down". </p>

<p>I want to hide the "move up" button on the first div and the "move down" button on the last div (or hide both if there is only one div). There can be no div, 1, 2, or many within the container.</p>

<p>The HTML would look something like this:</p>

<pre><code>&lt;div id="container"&gt;
    &lt;div id="div0"&gt;
        &lt;button class="btn-move-up"&gt;Move up&lt;/button&gt;
        &lt;button class="btn-move-down"&gt;Move down&lt;/button&gt;
    &lt;/div&gt;
    &lt;div id="div1"&gt;
        &lt;button class="btn-move-up"&gt;Move up&lt;/button&gt;
        &lt;button class="btn-move-down"&gt;Move down&lt;/button&gt;
    &lt;/div&gt;
    &lt;div id="div2"&gt;
        &lt;button class="btn-move-up"&gt;Move up&lt;/button&gt;
        &lt;button class="btn-move-down"&gt;Move down&lt;/button&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>How would I achieve this using jQuery?</p>
