title: how to check how many checkboxes are checked if i don't know their id's
body: <p>I have bunch of checkboxex generated from an php loop, and the code look like  this:</p>
  
  <pre><code> if ($searchQuerySelectedRooms === FALSE) {
         $searchQuerySelectedRooms = array();
   }
   foreach ($rooms as $room) {
       if (in_array($room['roomID'], $searchQuerySelectedRooms)) {
           $checker = 'checked="checked"';
       } else {
           $checker = '';
       }
       echo '&lt;input type="checkbox" id=box"'.$room['roomID'].'" name="rooms[]" value="' . $room['roomID'] . '" style="float:left;width:20px; margin-right:10px;" ' . $checker . ' class="box"/&gt;';
  </code></pre>
  
  <p>Bellow of this loop, i want to find out which checkboxes are checked and to append some html of the div with class newprice.</p>
  
  <p>I have searched on google, but all the examples starts use getElementById, which is useless in my case, since id's are build from the database, and I don't know which id's will be assigned to each checkbox.</p>
  
  <p>Anyone know how can I do this? </p>
  
  <p>Regards, John</p>