title: Loop between element with hasClass in jQuery
body: <p>I've little cards like this:</p>
  
  <pre><code>&lt;div class="card bordered" data-price="99.00"&gt;
      &lt;div class="card-header"&gt; Item 1 &lt;/div&gt;
      &lt;div class="card-content"&gt;Text&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Sometime a card can be active so I change the element class like this:</p>
  
  <pre><code>&lt;div class="card bordered" data-price="99.00"&gt;
      &lt;div class="card-header alert alert-danger"&gt; Item 1 &lt;/div&gt;
      &lt;div class="card-content"&gt;Text&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now, I need to loop into all my <code>.card</code> but only if the classes <code>alert alert-danger</code> are in my <code>div.card-header</code> and alert the <code>data-price</code>.</p>
  
  <p>I already tried:</p>
  
  <pre><code>$('.card &gt; .card-header').hasClass('alert alert-danger').each(function(i) {
      alert($(this).data('price'));
  });
  </code></pre>