json object to checked checkboxes

Posted by webmaster_sean on Stack Overflow See other posts from Stack Overflow or by webmaster_sean
Published on 2012-06-03T04:18:57Z Indexed on 2012/06/03 4:40 UTC
Read the original article Hit count: 180

Filed under:
|

I have this:

<div id="taglist">
<input type="checkbox" name="chkB1" id="chkB1" value="Mon" />&nbsp;Monday&nbsp;&nbsp;
<input type="checkbox" name="chkB2" id="chkB2" value="Tue" />&nbsp;Tuesday&nbsp;&nbsp;
<input type="checkbox" name="chkB3" id="chkB3" value="Wed" />&nbsp;Wednesday&nbsp;&nbsp;
<input type="checkbox" name="chkB4" id="chkB4" value="Thu" />&nbsp;Thursday&nbsp;&nbsp;<br />
<input type="checkbox" name="chkB5" id="chkB5" value="Fri" />&nbsp;Friday&nbsp;&nbsp;
<input type="checkbox" name="chkB6" id="chkB6" value="Sat" />&nbsp;Saturday&nbsp;&nbsp;
<input type="checkbox" name="chkB7" id="chkB7" value="Sun" />&nbsp;Sunday&nbsp;&nbsp;
<input type="hidden" name="source_frequency" id="source_frequency" value="" />
</div>

And this:

var days = ["Mon","Tue","Wed","Sun"];

I want the values from days make the corresponding check boxes checked. How would one do such a thing :-)

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON