Removing all Matching Classes in jQuery
<p>Hi I have an li element that will have something along the lines of this for a declaration</p>

<pre><code>&lt;li class="module ui-helper-fix"&gt;
</code></pre>

<p>And I can dynamically change the color of the module by adding on classes (That are provided dynamically through DB calls) the end result being </p>

<pre><code>&lt;li class="module ui-helper-fix module-green"&gt;
</code></pre>

<p>or</p>

<pre><code>&lt;li class="module ui-helper-fix module-default"&gt; 
</code></pre>

<p>Well I am fine with changing the color by adding on a new module-WHATEVER class but what I would like to do is remove any class that matches module-XXXX so it starts with a clean slate and then add on the class module-crimson.</p>

<p>So how do I remove all classes that match module-xxx first ? Keeping in mind I don't want to remove the base module class.</p>

<p>EDIT:</p>

<p>I basically need the method of doing a clean sweep on any module-  class:</p>

<p>Before Execution</p>

<pre><code>&lt;li class="module ui-helper-fix module-default"&gt;
</code></pre>

<p>After Clean Sweep</p>

<pre><code>&lt;li class="module ui-helper-fix"&gt;
</code></pre>

<p>Then Add Class and Final Result</p>

<pre><code>&lt;li class="module ui-helper-fix module-green"&gt;
</code></pre>

<p>Thanks.</p>

<p>-Seth</p>
