How to remove text from after an element with jQuery
<p>This demo code loops 3 times and every time appends text.
What I need is that text is not get appended but replaced, so that previously appended text should be removed before adding the new one.
I have tried a lot of things, nothing worked.</p>

<p><strong>EDIT: You can't add an extra tag after the span!</strong> </p>

<pre><code> &lt;div&gt;
     &lt;span id="i_1"&gt;this is &lt;/span&gt;
&lt;/div&gt;
​
var i = 3;
while(i&gt;0)
{
     //// how to remove the text added on the previous iteration?
    $("#i_1").after('text');
    i--;
}
​
</code></pre>

<p><a href="http://jsfiddle.net/pHYHW/" rel="nofollow">http://jsfiddle.net/pHYHW/</a></p>
