Changing order of class attributes in <em> tags
<p>I have several  tags in my page that look like this:</p>

<pre><code>&lt;em class="itemx item### itemy"&gt; text &lt;/em&gt;
</code></pre>

<p>where "#" are dynamic numbers.</p>

<p>I want to change it to </p>

<pre><code>&lt;em class="itemx item### itemy itemz"&gt; text &lt;/em&gt;
</code></pre>

<p>I've tried the following, but to no avail:</p>

<pre><code> $(".itemx item### itemy").replaceWith("&lt;em class='itemx item### itemy itemz'&gt;" + $(".itemx item### itemy").text() + "&lt;/em&gt;");
</code></pre>

<p>Can anyone tell me what I'm doing wrong? Or is there a better way?</p>

<p>Cheers.</p>
