JQuery change inner text but preserve html
<p>I would like to change the text of a HTML element but preserve the rest of the inner html with jQuery.</p>

<p>For instance:</p>

<pre><code>&lt;a href="link.html"&gt;Some text &lt;img src="image.jpg" /&gt;&lt;/a&gt; 
</code></pre>

<p>replace "Some text" with "Other text", and the result should look like:</p>

<pre><code>&lt;a href="link.html"&gt;Other text &lt;img src="image.jpg" /&gt;&lt;/a&gt; 
</code></pre>

<p><strong>EDIT:
My current solution is following:</strong></p>

<pre><code>var aElem = $('a');
var children = aElem.children();

aElem.text("NEW TEXT");
aElem.append(children); 
</code></pre>

<p>But there must be some more elegant way of doing this.</p>
