Find number of checkboxes with the same id that are checked
<p>I have a horrible problem trying to see if any of the checkboxes using a certain id is clicked.</p>

<p>An example of the checkboxes are </p>

<pre><code>&lt;input name="our_list[]" value="AB1-A" type="checkbox" class="listheck" id ="AB1 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB1-B" type="checkbox" class="listheck" id ="AB1 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB1-C" type="checkbox" class="listheck" id ="AB1 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB1-D" type="checkbox" class="listheck" id ="AB1 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB2-A" type="checkbox" class="listheck" id ="AB2 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB2-B" type="checkbox" class="listheck" id ="AB2 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB2-C" type="checkbox" class="listheck" id ="AB2 OB 90xs r5Ty" /&gt;
&lt;input name="our_list[]" value="AB2-D" type="checkbox" class="listheck" id ="AB2 OB 90xs r5Ty" /&gt;
</code></pre>

<p>and my latest script is</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function() {
    $('.listheck').click(function(){
        var thisID    = $(this).attr('id');
        var checked = $('#'+thisID+':checkbox:checked').length;
        alert(thisID+" Number checked:" + checked);
    }); 
});
&lt;/script&gt;
</code></pre>

<p>The alert shows the id of the checkbox but the checked value is always 0 even when they are checked</p>

<p>I know that each element id should be unique and that may be the problem or it may be that the id has spaces in it but this is for a system that is already been developed by someone else and unfortunately I cant change the way it works.</p>

<p>Ive tried lots of different solutions here but none seem to do what I need.</p>

<p>Any assistance appreciated</p>
