title: jQuery selector not working ([attribute~=value])
body: <p>I have many divs like this</p>
  
  <pre><code>&lt;div class="msg_header msg_header_for-219 media data-message="219"&gt;
  ...
  &lt;/div&gt;
  </code></pre>
  
  <p>I use </p>
  
  <pre><code>$(".msg_header_for-&lt;%= msg.id %&gt;").css("background-color", "red");
  </code></pre>
  
  <p>to pick a specific id and color it red.</p>
  
  <p>I want to color the rest of the divs white</p>
  
  <p>so I have 2 lines</p>
  
  <pre><code>$("[class~='msg_header_for']").css("background-color", "white");
  $(".msg_header_for-&lt;%= msg.id %&gt;").css("background-color", "red");
  </code></pre>
  
  <p>the first one, as I understand, will select any class with msg_header_for in the class name and make it white. the second one will pick a specific one and color it red.</p>
  
  <p>The red part works. The white one doesn't.</p>
  
  <p>I don't understand why the first selector doesn't work. 
  What is wrong?</p>