How to flash(hide/clear/delete) the previously appended values on every new click?
<p>Whenever I click, the new value  is appended but the previous value is also shown. How can I clear the previously appended values on every new click?</p>

<p>Here goes the onclick used in php function</p>

<pre><code>echo "&lt;a href='#' onclick=chat_com('$name'); &gt;$name &lt;/a&gt;&lt;br&gt;";  // suppose this dispalyes a,b,c
</code></pre>

<p>Here is jquery function to append this value.</p>

<pre><code>function chat_com(name) {
    $('#appendto').append(name);
}
</code></pre>

<p>Here is the HTML div where value is appended.</p>

<pre><code>&lt;div id="appendto"&gt;&lt;/div&gt;
</code></pre>

<p>On first click <code>a</code> is shown, on second click <code>a,b</code> is shown instead just <code>b</code>.</p>
