title: Javascript/jquery replace text removes formatting of div
body: <p><a href="http://jsfiddle.net/2EvGF/" rel="nofollow">http://jsfiddle.net/2EvGF/</a></p>
  
  <p>JS</p>
  
  <pre><code>$('.msgln').each(function() {
      var text = $(this).text();
      $(this).text(text.replace('Admin', 'sys-admin')); 
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class='msgln'&gt;&lt;b&gt;Admin&lt;/b&gt;:&lt;i&gt; Chat cleared&lt;/i&gt;&lt;br&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Replacing the class '.msgln' removes the formatting (bold, italics, etc.) How can I resolve this?</p>