title: Find an element with a specific data attribute jQuery
body: <p>I understand that I can always iterate down the DOM tree and check every element for a data field and if the value is correct but I would like a cleaner solution.  For example</p>
  
  <pre><code>    &lt;div id="theDiv"&gt;
         &lt;div&gt;
           &lt;span data-num="3" &gt;&lt;/span&gt;
           OTHER HTML
         &lt;/div&gt;
         &lt;div&gt;
           &lt;div&gt;&lt;span data-num="23"&gt;&lt;/span&gt;&lt;div&gt;
           OTHER HTML
         &lt;/div&gt;
         &lt;div&gt;
           &lt;span data-num="3"&gt;&lt;/span&gt;
           OTHER HTML
         &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Is there a jQuery one liner to find all spans with data-num=3?  I know I can find all spans by </p>
  
  <pre><code>  $("#theDiv").find(span).each(function(e) { ... });
  </code></pre>
  
  <p>but I would like something like</p>
  
  <pre><code>  $("#theDiv").find(span &gt; data-num=3).each(function(e) { ... });
  </code></pre>