title: Javascript : Append text into div?
body: <p>I want use javascript to append clock into inside of a div. Here is my code : </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
  function makeArray() {
  for (i = 0; i&lt;makeArray.arguments.length; i++)
  this[i + 1] = makeArray.arguments[i];
  }
  
  var months = new makeArray('January','February','March','April','May',
  'June','July','August','September','October','November','December');
  var date = new Date();
  var day = date.getDate();
  var month = date.getMonth() + 1;
  var yy = date.getYear();
  var year = (yy &lt; 1000) ? yy + 1900 : yy;
  
  var timer = document.write(months[month]+ " " +day + ", " + year);
  document.getElementById('time').appendChild(timer);
  //]]&gt;&lt;/script&gt;
  
  &lt;div id='time'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>But it doesn't work. Help me for fixing it. Thanks you.</p>