check uncheck all checkbox of checkboxlist using jquery ASP.Net
<p>i was trying to check uncheck all option of checkboxlist programmatically but my code is not working. here is snippet</p>

<pre><code> $(document).ready(function () {
    $('#myLink').click(function () {
        $("INPUT[id^='chkFileds']").attr('checked', $('#chkFileds').is(':checked'));
    });
});
</code></pre>

<p>what is wrong in my code. i want that when user click on check hyperlink then all option of checkbox list will be checked and when click again on the same link then all option of checkbox list will be uncheck. please guide me how to do it. thanks</p>

<p><strong>UPDATE:</strong></p>

<p>thanks for ur answer but i am not talking about check rather checkbox list what has many checkbox inside.it looks like....he i am giving the html of checkboxlist</p>

<pre><code>&lt;table style="font-weight:bold;" id="chkCountry"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;input type="checkbox" value="GB" name="chkCountry$0" id="chkCountry_0"&gt;
                &lt;label for="chkCountry_0"&gt;UK&lt;/label&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;input type="checkbox" value="US" name="chkCountry$1" id="chkCountry_1"&gt;
                &lt;label for="chkCountry_1"&gt;USA&lt;/label&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>
