jQuery replaceWith() displaces inner text/html of replacement
<p>I'm using replaceWith() to replace a link with another link with a different onchange and an internal span tag, like so:</p>

<pre><code>$(a.class).replaceWith("&lt;a onclick='return ajax_spam(this);' /&gt;&lt;span&gt;Unflag as Spam&lt;/span&gt;&lt;/a&gt;");
</code></pre>

<p>This works except for the span tag is placed after the closing  tag. Same happens if I replace the span tag with just text. </p>

<p>Any ideas?</p>
