title: Jquery Find element with specific data attribute
body: <p>What function can I use to select child div of class="rate_stars".</p>
  
  <p>I have a variable range from 1 - 5 and I want to select child div with that specific data-rating. </p>
  
  <p>I have tried</p>
  
  <pre><code> $('rate_widget').find().attr('data-rating', info).prevAll().andSelf().addClass('ratings_vote');
  </code></pre>
  
  <p>But it did't work.</p>
  
  <pre><code>&lt;div id="r1" class="rate_stars"
                               data-post-id="&lt;?php echo $post_id ?&gt;"
                               data-user-id="&lt;?php echo $user_id;  ?&gt;"
                               data-nonce="&lt;?php echo $nonce ?&gt;"
                              &gt;
      &lt;div data-rating="1" class="ratings_stars"&gt;&lt;/div&gt;
      &lt;div data-rating="2" class="ratings_stars"&gt;&lt;/div&gt;
      &lt;div data-rating="3" class="ratings_stars"&gt;&lt;/div&gt;
      &lt;div data-rating="4" class="ratings_stars"&gt;&lt;/div&gt;
      &lt;div data-rating="5" class="ratings_stars"&gt;&lt;/div&gt;
      &lt;div class="total_votes"&gt;vote data&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>