I have a unique checkbox modal window
<div class="tv-choices" style="display:none;"><!-- turned on via button-->
<div class="choices-title">TV</div>
<div class="choices-checkboxes">
<div class="category_box">
<input type="checkbox" id="getf{038}" name="getfItem" value="Adult Animated">
<label for="get{038}">Adult Animated</label>
</div>
<div class="category_box">
<input type="checkbox" id="getf{9FA}" name="getfItem" value="Anime">
<label for="get{9FA}">Anime</label>
</div>
<div class="category_box">
<input type="checkbox" id="getf{821}" name="getfItem" value="Award Shows">
<label for="get{821}">Award Shows</label>
</div>
</div>
Now I have a multi-dimensional array:
object_with_arrays['genreAry'+ary_Num]
Let's say Array object_with_arrays[genreAry1]
has: Adult Animated and Anime but not Award Shows. How would you now get those checkboxes to get checked via jQuery?
Project story: I have 9 generated buttons which create a Modal window on the fly, each modal window serves up a set of checkboxes. Since I'm using 1 modal window I have to clear out the pervious checkboxes. I found this code below which works, but I just can't seem to figure out how to re-populate the checkboxes with my Arrays
$('.tv-choices').find(':checked').each(function() {
$(this).removeAttr('checked');
});