How can access bunch of <li>?
<p><br />
I have a list of texts and I want to change their innerHTML. how can I do that by javascript if I have thousands of li tag (whose data come from database)?</p>

<pre><code>&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;a&lt;/li&gt;
&lt;li&gt;as&lt;/li&gt;
&lt;li&gt;asd&lt;/li&gt;
&lt;li&gt;asds&lt;/li&gt;
&lt;li&gt;asdsa&lt;/li&gt;
&lt;li&gt;asdsad&lt;/li&gt;
&lt;li&gt;asdsadz&lt;/li&gt;
&lt;li&gt;asdsadzc&lt;/li&gt;
....
.....
&lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>-Thanks.</p>

<p><strong>Update</strong>
JS code being used:                                       </p>

<pre><code>function a(){
    var parent = document.getElementById("z");
    var i = 0;
    for(i = 0; i &lt;= parent.children.length; i++){
        if(parent.children[i].tagName == "LI"){
            if(i%2!=0){
                parent.children[i].innerHTML="ok";
            }
        }
    }
}
document.onload=a(); // this didn't work. so I called the function in body tag instead of that.
&lt;body onload="a();"&gt;
</code></pre>
