javascript- want to set li innerHTML of ul
<p>I'm writing a javascript function where I get a ul object from my HTML and want to set the text of one of the li elements in the ul. I'm doing:</p>

<pre><code>list = document.getElementById('list_name');
</code></pre>

<p>Then I want to access the ith li element of list using a loop.
I have:</p>

<pre><code>for (i = 0; i &lt; 5; i++) {
    list[i].innerHTML = "&lt;a&gt;text&lt;/a&gt;"; 
}
</code></pre>

<p>but this is not working. What is the proper way to do it?</p>
