title: Loop through all checkboxs in a div with certain class
body: <p>i want to loop through certain checkboxes with a specific class that are inside a div.
  I know how i can achieve this by adding ID's to each and everyone of them but that's not what i want to go for. Below is my code</p>
  
  <p>JS</p>
  
  <pre><code>&lt;script&gt;
  function calculate()
  {
      $('#payments').find('.checkBoxP').each(function() {
          if ( $('.checkBoxP').prop('checked') )
          {
              alert('its on');
          }
          if ( !$('.checkBoxP').prop('checked') )
          {
              alert('nope');
          }
      });
  }
  
  calculate();
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="row-fluid" id="payments"&gt;
     &lt;div class="span4"&gt;Sale No # 112&lt;div class="widget-header"&gt;
                      &lt;span&gt;Pizza&lt;/span&gt;
                          &lt;span class="shopp-price" style="margin-right:5px;"&gt; $&lt;em&gt;10.90&lt;/em&gt;
                          &lt;/span&gt;
                          &lt;span class="widget-toolbar"&gt;
                              &lt;label&gt;
                                  &lt;input onchange="calculate();" type="checkbox" class="checkBoxP"&gt;&lt;/input&gt;
                                  &lt;span class="lbl"&gt;&lt;/span&gt;
                              &lt;/label&gt;
                          &lt;/span&gt;
                      &lt;/div&gt;Sale No # 110&lt;div class="widget-header"&gt;
                      &lt;span&gt;Coca Cola&lt;/span&gt;
                          &lt;span class="shopp-price" style="margin-right:5px;"&gt; $&lt;em&gt;17.20&lt;/em&gt;
                          &lt;/span&gt;
                          &lt;span class="widget-toolbar"&gt;
                              &lt;label&gt;
                                  &lt;input onchange="calculate();" type="checkbox" class="checkBoxP"&gt;&lt;/input&gt;
                                  &lt;span class="lbl"&gt;&lt;/span&gt;
                              &lt;/label&gt;
                          &lt;/span&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>Note that below there are couple more <code>inputs</code> which i don't want to include in the search that's why i have inserted the class.</p>