javascript add tag before and after another
<p>I've got this code: </p>

<pre><code>&lt;div id="pageNavigator" class="rbcContentBlock"&gt;
&lt;ul&gt;
&lt;a href="/home/"&gt;Úvod&lt;/a&gt;
&lt;span&gt;&lt;span&gt; &amp;gt; &lt;/span&gt;&lt;/span&gt;
&lt;a href="/fontanova-cerpadla/"&gt;Fontánová čerpadla&lt;/a&gt;
&lt;span&gt;&lt;span&gt; &amp;gt; &lt;/span&gt;&lt;/span&gt;
&lt;span id="navCurrentPage"&gt;Pontec PondoVario 1000&lt;/span&gt;
&lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>I would like to put "li" tags before and after tags "a". I tried to make something, here is my javascript code:</p>

<pre><code>var div1 = document.getElementById("pageNavigator");
var elements = div1.getElementsByTagName("a");
var parentDiv = elements.parentNode;
var li = document.createElement("li");
parentDiv.insertBefore(li, elements);
</code></pre>

<p>What's wrong with this code? Is the problem that elements is "array"? Thanks for help.</p>
