I am trying to set the checked property based on a comma delimited string stored in the model. This issue is the checked property is not being. Does anyone see what I am doing wrong? Here is what I have:

Data returned from controller...

```
V1P01,V1P02,V1P03

```

View code. 

```
$(document).ready(function () {
    var array = "@Model.IncidentVehicle.VA_Sub1VehicleDamage".split(',');
    for (var i in array)
        $("[name=myCheckboxName][value=" + $.trim(array[i]) + "]").attr('checked', true);
    });

```

```html
<div class="carCBsPassenger">
    <input name="V1P01" id="V1P01" type="checkbox" value="V1P01" style="border: none;" />
    <input name="V1P02" id="V1P02" type="checkbox" value="V1P02" style="border: none;" />
    <input name="V1P03" id="V1P03" type="checkbox" value="V1P03" style="border: none;" />
    <input name="V1P04" id="V1P04" type="checkbox" value="V1P04" style="border: none;" />
    <input name="V1P05" id="V1P05" type="checkbox" value="V1P05" style="border: none;" />
    <input name="V1P06" id="V1P06" type="checkbox" value="V1P06" style="border: none;" />
    <input name="V1P07" id="V1P07" type="checkbox" value="V1P07" style="border: none;" />
    <input name="V1P08" id="V1P08" type="checkbox" value="V1P08" style="border: none;" />
    <input name="V1P09" id="V1P09" type="checkbox" value="V1P09" style="border: none;" />
    <input name="V1P10" id="V1P10" type="checkbox" value="V1P10" style="border: none;" />
    <input name="V1P11" id="V1P11" type="checkbox" value="V1P11" style="border: none;" />
    <input name="V1P12" id="V1P12" type="checkbox" value="V1P12" style="border: none;" />
    <input name="V1P13" id="V1P13" type="checkbox" value="V1P13" style="border: none;" />
    <input name="V1P14" id="V1P14" type="checkbox" value="V1P14" style="border: none;" />
</div>

```