title: listbox onchange - appendChild
body: <p>here is the code I have. </p>
  
  <pre><code>//Header container  - summary info
  var headerdiv = document.getElementById("Editsubmission");
  var cont1=document.createElement('div');
  var cont2=document.createElement('div');
  cont1.textContent="Your submission will be sent to: " +variable1;
  cont2.textContent="reporting back to: "+ variable2;
  
  headerdiv.appendChild(cont1);
  headerdiv.appendChild(cont2);
  </code></pre>
  
  <p>I'm trying to populate dynamically created DIVs with some text by manipulating listboxes (variable1 and variable2). The problem is that if I'll select another option before form submission, new text will be obviously appended to the DIV. I need old text to be deleted before that. Apparently I shouldn't be useing 'appendChild'. Please advice. </p>