remove all <li> from <ul>?
<p>hi all i am appending li in ul from the following code</p>

<pre><code>for(var i=1;i&lt;=len;i++){
    li=document.createElement('li');
    element = document.createElement("img");
    element.setAttribute("src", path[i]);
    li.appendChild(element);
    root.appendChild(li);
} 
</code></pre>

<p>now i want to remove all item on button click
and i m using this code which is not working </p>

<pre><code>while(root.hasChildNodes()){
root.removeChild('li');
} 
</code></pre>

<p>the condition is true but the inner line root.removechild('li'); does not work i also tried  these mentioned options  --> root.removeChild(root li) , ('#listid li'), ('ul li') ... 
is there anything missing or any other way to remove items from list ? thnx in advance</p>
