Simple Javascript issue
<p>I want select all the elements with the <code>id</code> named singleFeed1 to singleFeed10;</p>

<pre><code>for (var i=0;i&lt;10;i++){
    var post=document.getElementById('singleFeed'+i);
    post.style.color='blue';

    if (i==4){
        post.style.color='red';
    }
}
</code></pre>

<p>It doesn't seem to work.</p>

<p>my html</p>

<pre><code>&lt;li id=singleFeed1&gt;aaaaaaaaaaaa&lt;/li&gt;
&lt;li id=singleFeed2&gt;vvvvvvvvvvvv&lt;/li&gt;
&lt;li id=singleFeed3&gt;dddddddddddd&lt;/li&gt;
&lt;li id=singleFeed4&gt;aqqqqqqqqq&lt;/li&gt;
&lt;li id=singleFeed5&gt;aaaaaddddaa&lt;/li&gt;
......
......
​
</code></pre>

<p>Anyone has better solutions? Thanks.</p>
