title: How to append div in existing div?
body: <p>Hello I am creating website using php.In that i have  one form which is for add appointment. in that page user can fillup date, start Time and End time of appointment. but if user want to add extra date and time he/she can also add. for that i have write following code.</p>
  
  <pre><code>   &lt;div id="date"&gt;
     &lt;table&gt;
     &lt;tr&gt;
     &lt;td&gt;
     Date&lt;br&gt;
     &lt;input type="text" id="dateid"&gt;
     &lt;/td&gt;
     &lt;td&gt;startTime:&lt;select&gt;&lt;option value="00:00"&gt;00:00&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
     &lt;td&gt;EndTime:&lt;select&gt;&lt;option value="00:00"&gt;00:00&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;
     &lt;td&gt;&lt;input type="button" value="Extra Time" onClick="addTime()"&gt;&lt;/td&gt;
     &lt;/tr&gt;
     &lt;/table&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>for onlick event i have create on function.</p>
  
  <pre><code>   &lt;script&gt;
     function addTime() 
  {
  var timeDiv='&lt;div id="extraTimeDiv"&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;Date&lt;br&gt;&lt;input type="text" id="extradate"&gt;&lt;/td&gt;&lt;td &gt;Start Time&lt;/td&gt;&lt;td&gt;&lt;select id="addstart" name="addstart"&gt;&lt;option value="00:00"&gt; 00:00&lt;/option&gt;&lt;option value="00:30"&gt; 00:30&lt;/option&gt;&lt;option value="01:00"&gt; 01:00&lt;/option&gt;&lt;option value="01:30"&gt; 01:30&lt;/option&gt;&lt;option value="02:00"&gt; 02:00&lt;/option&gt; EndTime:&lt;/td&gt;&lt;td &gt;&lt;select id="addend" name="addend"&gt;&lt;option value="00:00"&gt; 00:00&lt;/option&gt;&lt;option value="00:30"&gt; 00:30&lt;/option&gt;&lt;option value="01:00"&gt; 01:00&lt;/option&gt;&lt;option value="01:30"&gt; 01:30&lt;/option&gt;&lt;option value="02:00"&gt; 02:00&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;'
  
     var div = document.getElementById('date');
  div.innerHTML = div.innerHTML + timeDiv;
  
    }
  &lt;/scritp&gt;
  </code></pre>
  
  <p>this works fine but when when i click on more then previous selected data erased. data should be as it is when i press more to add extra time. kidnly help me how to solve this problem? Thank you in advance. </p>