title: Replacing / Manipulating element in html string using jquery
body: <p>I have a html string (not DOM), that I want to manipulate using jquery. Why doesn't this work:</p>
  
  <pre><code>var html = '&lt;div&gt;&lt;h4&gt;&lt;a class="preview-target" href="content.html"&gt;Headline&lt;/a&gt;&lt;/h4&gt;&lt;/div&gt;';
  console.log(html);
  
  var elem = $('h4', $(html));
  // replace "Headline" with "whatever" =&gt; Doesn't work
  elem.replaceWith("whatever");
  
  console.log(html);
  </code></pre>
  
  <p>I have a jsfiddle <a href="http://jsfiddle.net/nachtigall/XpWdA/2/">here</a> for testing. </p>
  
  <p>The above code is just a simplified example. The real html is much more complex, that is, I definitely need to rely on jQuery for manipulating the html string.</p>