Jquery Selecting all checkboxes when one checkbox is selected
<p>I have an array of checkboxes that gets built from a smarty template. When a particular checkbox is selected with a value of WTOPS, I want this action to select all the other checkboxes in the div. Here is my code below which is not working</p>

<p>Here is my jquery:</p>

<pre><code>$("input[name=levelCheck]").change(function () {
if ($("input[name=levelCheck]:checked").val() == 'WTOPS') {
$("input[type='checkbox']").attr('checked', true);  
}
});
</code></pre>

<p>Here is the HTML:</p>

<pre><code>&lt;div id="Women"&gt;
&lt;label&gt; &lt;input type="checkbox" name="level_desc[]" id="levelCheck" value="WOPEN"&gt; Open &lt;/label&gt;
&lt;label&gt; &lt;input type="checkbox" name="level_desc[]" id="levelCheck" value="WPREPOPT"&gt; Prep Opt &lt;/label&gt;
&lt;label&gt; &lt;input type="checkbox" name="level_desc[]" id="levelCheck" value="WTOPS"&gt; TOPS &lt;/label&gt;
&lt;/div&gt;
</code></pre>
