title: removing a class that contains a set of characters
body: <p>Is there a way to remove a class that starts or contains a defined text string?</p>
  
  <p>I have several classes for background color overides that start <code>.bg</code></p>
  
  <pre><code>.bgwhite
  .bgblue
  .bgyellow
  </code></pre>
  
  <p>I've set up a little jquery for a select box that adds and removes modifying classes to an element, in this case an <code>&lt;a href id="buttontostyle"&gt;</code> tag
  I need to remove these classes that start with <code>.bg</code>, while keeping another class which determines the size of the buttons
   so something like this:</p>
  
  <pre><code>    $("#buttoncolors").change(function() // buttoncolors is the select id
      {
          var valcolor = $("#buttoncolors").val();
          $("#buttontostyle").removeClass("bg" + "*");
          $("#buttontostyle").addClass(valcolor);
  
      });
  </code></pre>