Filter out an element's classes in jQuery?
<p>What is the most efficient way to filter the list of classes on a given element?</p>

<pre><code>&lt;div class="foo bar"&gt;&lt;/div&gt;
&lt;div class="bim bar"&gt;&lt;/div&gt;

$("div.bar").click(function(ev) {
  alert("The non-bar class was:" + ???);
});
</code></pre>

<p>I know I could write a for-loop to go through the ev.currentTarget.classList but I want to know if there's a better way.</p>

<p>EDIT: I'd like to clarify that I want the alert to tell me "foo" and "bim." I don't want to <em>replace</em> "bar," I just want to be able to access the classes that are NOT bar. Thanks.</p>
