How to select elements using jQuery by partial ID and a class at the same time?
<p>When I want to select all the components by a partial ID <strong>or</strong> by its class, I use the following.</p>

<pre><code>var identify = $("[id*=donkey]");
var classify = $(".wonkey");
</code></pre>

<p>The thing is now that I want to restrict the set returned by <strong>identification</strong> so that each element still in there also is a member of <strong>classification</strong>.</p>

<p>The closest I've got by goolearching is along the <a href="https://stackoverflow.com/a/17417622/1525840">suggestion here</a> but that's only valid for elements that are children <strong>under</strong> their parent. That's not my case. I want to select the elements like this.</p>

<pre><code>&lt;bopp id="head-donkey" class="wonkey" /&gt;
&lt;bopp id="donkey-butt" class="wonkey" /&gt;
&lt;bopp id="head-donkey-butt" class="wonkey" /&gt;
</code></pre>

<p>But I want to exclude elements like this.</p>

<pre><code>&lt;bopp id="banana" class="wonkey" /&gt;
&lt;bopp id="don-key" class="wonkey" /&gt;
&lt;bopp id="donkey" class="not-won-key" /&gt;
</code></pre>

<p>I can't find any info on that operation, though...</p>