title: Filter divs by data-attr containing string
body: <p>How to filter a number of divs based on what they have in their custom <code>data</code> attribute using jQuery? The problem is that the attribute can have more than 1 values (which is treated as 1 string). So I need to work out if the <code>data-att</code> value contains a string.</p>
  
  <pre><code>&lt;a href=""&gt;small&lt;/a&gt;
  &lt;a href=""&gt;medium&lt;/a&gt;
  &lt;a href=""&gt;large&lt;/a&gt;
  
  &lt;div class="size" data-size="small"&gt;small tee&lt;/div&gt;
  &lt;div class="size" data-size="small medium"&gt;small tee&lt;/div&gt;
  &lt;div class="size" data-size="small medium"&gt;small tee&lt;/div&gt;
  &lt;div class="size" data-size="small"&gt;small tee&lt;/div&gt;
  &lt;div class="size" data-size="medium large"&gt;small tee&lt;/div&gt;
  &lt;div class="size" data-size="medium large"&gt;small tee&lt;/div&gt;
  </code></pre>
  
  <p>So if small link is clicked it should show only the divs whose data-size value contains small, so 'small' and 'small medium'.</p>
  
  <p>I've tried:</p>
  
  <pre><code>$("a").click(function(e) {
      var selectSize = $(this).text();
      filter(selectSize)
              e.preventDefault();
  });
  
  function filter(e){
  $('.tyre').hide()
      .filter('[data-sizes=""]:contains(' + e + ')')
      .show(); // show the filtered elements
  }
  </code></pre>
  
  <p>but no go.</p>