title: JavaScript Max number of checked input type checkbox
body: <p>Using ASP.NET to generate several checkboxes. Looking for a JavaScript solution that will test any checkbox starting with the name <code>pdf*</code> to see if more than 5 are checked, then alert over that number.</p>
  <p>There are other checkboxes I do not want this to run on that do not have the name <code>pdf*</code>.</p>
  <p>Thanks in advance.</p>
  <p>here is an example of my checkboxs:</p>
  <pre><code>&lt;td&gt;&lt;input type=&quot;checkbox&quot; name=&quot;pdf14&quot; value=&quot;2250&quot;&gt;&lt;/td&gt;
  
  &lt;td&gt;&lt;input type=&quot;checkbox&quot; name=&quot;pdf15&quot; value=&quot;2251&quot;&gt;&lt;/td&gt;
  
  &lt;td&gt;&lt;input type=&quot;checkbox&quot; name=&quot;pdf16&quot; value=&quot;2252&quot;&gt;&lt;/td&gt;
   
  &lt;td&gt;&lt;input type=&quot;checkbox&quot; name=&quot;print&quot; value=&quot;2253&quot;&gt;&lt;/td&gt; 
  </code></pre>
  <p><strong>&lt;&lt;&lt;NOT A PART OF THE COUNT</strong></p>