title: Append to a webpage in javascript
body: <p>What I want to do is that: a webpage with continuously updating content. (In my case is updating every 2s) New content is appended to the old one instead of overwriting.</p>
  
  <p>Here is the code I have:</p>
  
  <pre><code>var msg_list = new Array(
      "&lt;message&gt;Hello, Clare&lt;/message&gt;", "&lt;message&gt;Hello,Lily&lt;/message&gt;",
      "&lt;message&gt;Hello, Kevin&lt;/message&gt;", "&lt;message&gt;Hello, Bill&lt;/message&gt;"
  );
  var number = 0;
  function send_msg()
  {
   document.write(number + " " + msg_list[number%4]+'&lt;br/&gt;');
   number = number + 1;
  }
  var my_interval = setInterval('send_msg()', 2000); 
  </code></pre>
  
  <p>However, in both IE and Firefox, only one line is printed out, and the page will not be updated anymore. Interestingly in Chrome, the lines are being printed out continuously, which is what I am looking for.</p>
  
  <p>I know that document.write() is called when the page is loaded according to <a href="http://javascript.about.com/library/blwrite.htm" rel="nofollow noreferrer">this link</a>. So it's definitely not the way to update the webpage continuously. What will be the best way to achieve what I want to do?</p>
  
  <p>Totally newbie in Javascript. Thank you.</p>
  
  <p>Lily  </p>