checking boxes from a list of values
<p>i have a list of values:</p>

<pre><code> &lt;script&gt;
 $().ready(function() {
var pi = '1,8';
    $('#items_'+i).attr("checked",true);
 });
 &lt;/script&gt;                    

1 &lt;input type="checkbox" id="items_1" name="myitems" value="1"  /&gt; &lt;br/&gt;
2 &lt;input type="checkbox" id="items_2" name="myitems" value="2"  /&gt; &lt;br/&gt;
3 &lt;input type="checkbox" id="items_3" name="myitems" value="3"  /&gt; &lt;br/&gt;
4 &lt;input type="checkbox" id="items_4" name="myitems" value="4"  /&gt; &lt;br/&gt;
5 &lt;input type="checkbox" id="items_5" name="myitems" value="5"  /&gt; &lt;br/&gt;

6 &lt;input type="checkbox" id="items_6" name="myitems" value="6"  /&gt; &lt;br/&gt;
7 &lt;input type="checkbox" id="items_7" name="myitems" value="7"  /&gt; &lt;br/&gt;
8 &lt;input type="checkbox" id="items_8" name="myitems" value="8"  /&gt; &lt;br/&gt;
9 &lt;input type="checkbox" id="items_9" name="myitems" value="9"  /&gt; &lt;br/&gt;
</code></pre>

<p>based on the above list pi, i want to only check items_1 and items_8. not sure how.</p>
