title: How to filter options by data-attribute with jQuery?
body: <p>I have a select box with various options:</p>
  
  <pre><code>&lt;select id="person"&gt;
    &lt;option data-project_ids=​"11 23 19" value=​"17"&gt;​Goodwin, Alisha​&lt;/option&gt;​
    &lt;option data-project_ids=​"16" value=​"20"&gt;​Ratke, Danny​&lt;/option&gt;​
    &lt;option data-project_ids=​"" value=​"16"&gt;​Powlowski, Ron​&lt;/option&gt;​
    &lt;option data-project_ids=​"19 7" value=​"20"&gt;​Ratke, Danny​&lt;/option&gt;​
  &lt;/select&gt;
  </code></pre>
  
  <p>How can I filter the options by a <code>data-project_id</code>?</p>
  
  <p>Right now I have:</p>
  
  <pre><code>var project = 19; // just an example
  $('#person').html().filter('[data-project_ids="' + project + '"]');
  </code></pre>
  
  <p>This <em>would</em> work if every option had only <em>one</em> <code>data-project_id</code>. However, there are often many, sometimes none at all.</p>
  
  <p>Thanks for any help.</p>