Clear text inside DIV
<p>I'm using the following HTML structure:</p>

<pre><code>&lt;div id="clock"&gt;5:30 AM
    &lt;div id="day"&gt;Wednesday
    &lt;/div&gt;
    &lt;div id="date"&gt;14 December
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I update the contents of these elements using Javascript. For "day" and "date" I use <code>$("#day").text(day)</code> and <code>$("#date").text(date)</code>. Because "clock" is a parent element I had to use <code>$("#clock").prepend(clock)</code> to succesfully add the text.</p>

<p>The problem with the latter function, is that new text is prepended every time the clock is refreshed, i.e. it builds up a list of clock times. For the first two functions the text is just replaced, like it should. Is there a way to make this happen for the "clock" function as well?</p>

<p>EDIT: Sorry, should have been a bit more clear about the clock. Have edited the code, so you understand. BTW, the reason the clock is parent element is that could make the other two elements depend on the clock's position and styling.</p>

<p>I also created a jsFiddle: <a href="http://jsfiddle.net/KeyMs92/NZtFA/" rel="nofollow">http://jsfiddle.net/KeyMs92/NZtFA/</a>
I left the list building thing (annoyingly) in!</p>

<p>BTW, I'm not too sure if <code>function(); setInterval('function()', 1000)</code> is the best way to refresh, so if you something better I'd be happy to know :)</p>
