How to reverse the ordering of list items in an unordered list
<p>Let's say I have an unordered list, like this:</p>

<pre><code>&lt;ul id="birds"&gt;
  &lt;li&gt;Bald Eagle&lt;/li&gt;
  &lt;li&gt;Falcon&lt;/li&gt;
  &lt;li&gt;Condor&lt;/li&gt;
  &lt;li&gt;Albatross&lt;/li&gt;
  &lt;li&gt;Parrot&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>With plain JavaScript (not including jQuery), I would like to be able to do reverse the order of this list - so that it matches the following expected "output":</p>

<pre><code>&lt;ul id="birds"&gt;
  &lt;li&gt;Parrot&lt;/li&gt;
  &lt;li&gt;Albatross&lt;/li&gt;
  &lt;li&gt;Condor&lt;/li&gt;
  &lt;li&gt;Falcon&lt;/li&gt;
  &lt;li&gt;Bald Eagle&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>This is the JavaScript I have attempted to code, to try and achieve this goal:</p>

<pre><code>var birdList = document.getElementById("birds").getElementsByTagName("li");
var birdListReverse = birdList.reverse();

for(var i = 0; i &lt; birdList.length; i++)
{
  birdList[i] = birdListReverse[i];
}
</code></pre>

<p>I would think that somehow over-writing the current list items with the ones in the "reversed" list would be sufficient, but not to be. Would I have to somehow manipulate each <code>nodeValue</code> in the list?</p>

<p>I would like to do this when a button is clicked - that is the easy part, it is just getting the technique to reverse the list that has hampered me a bit.</p>
