Alert message box is not displaying when a checkbox is checked
<p>I want to know whether at least on checkbox was checked, so I'm using the following code.</p>

<pre><code>function CheckIfAtLeastOneBoxIsCheckedBeforeSavingForm() {
  var n = $('input[id*="ckHMreq"]:checked').length;
  alert(n);
}
</code></pre>

<p>When no checkbox is checked, the alert message box displays 0. However, when at least one checkbox is checked then the alert message box doesn't even display. </p>

<p>Any reason for that?</p>

<h1>EDIT</h1>

<p>This is the HTML produced by the browser</p>

<pre><code>&lt;input id="contentMain_cklistPayroll_gvCKList_ckHMreq_0" type="checkbox" name="_ctl0:contentMain:cklistPayroll:gvCKList:_ctl2:ckHMreq" /&gt;
</code></pre>

<p>I also added "checked" to the jquery code. I still get 0 when no checkbox is checked and no message box when any checkbox is checked.</p>
