Remove child node error
<p>I am having problems with the code below, i keep getting this error in Opera:</p>

<pre><code>Uncaught exception: DOMException: NOT_FOUND_ERR
</code></pre>

<p>And this in Chrome:</p>

<pre><code>Uncaught Error: NOT_FOUND_ERR: DOM Exception 8
</code></pre>

<p>This messages refers to removeInput function:</p>

<pre><code>function addInput() {
  var div = document.createElement("div");
  var txt = "&lt;div&gt;Upload image: &lt;input type='file' name='slika[]' /&gt; &lt;span onclick='removeInput(this.parentNode)' /&gt;Remove &lt;img src='catalog/remove_icon.png' /&gt;&lt;/span&gt;&lt;/div&gt;";
  div.innerHTML = txt;
  document.getElementById('text').appendChild(div);
}

function removeInput(el) {
  document.getElementById('text').removeChild(el);
}
</code></pre>

<p>Question is: how to remove element previosly created by addInput function? Is this right way to remove element dynamicaly?</p>
