title: How to replace element without childs in jQuery?
body: <p>I want to replace an element but leave the child nodes intact.</p>
  
  <pre><code>var $row = $j('td[id^=someId]').parent();
  
  $row.replaceWith('&lt;tr class="headerRow"&gt;' + $row.html() + '&lt;/tr&gt;');
  
  $row.children().each(function () {
      $j(this).replaceWith('&lt;th class="headerRow"&gt;' + $j(this).html() + '&lt;/th&gt;');
  });
  </code></pre>
  
  <p>The first replaceWith works - the second doesn't. Any ideas why?</p>