title: jQuery: Select only a class containing a string?
body: <p>I'm currently using this to get the class for a specific bit of HTML on the page:</p>
  
  <pre><code>$(this).parent("div").attr('class')
  </code></pre>
  
  <p>But that <code>div</code> has multiple classes: <code>current_status status_billed</code></p>
  
  <p>My end goal here is to grab the class that starts with <code>status_</code> and replace it with a different class name.</p>
  
  <p>So using my <code>.parent()</code> function above, I'm able to select the div I need, but I then need to remove the <code>status_billed</code> class and replace it with, for example, <code>status_completed</code> (or a number of other class names).</p>