title: innerHTML doesn't work properly
body: <p>I have some problem guys. in my code when i click on add button it will adding a new row which will have a different id. but when i add a new row the content of Previous row will be deleted. i want that it save its content. what should i do? here is my code: </p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta charset="UTF-8"&gt; 
      &lt;script&gt;
      var currRow=0;
      function addRow(){
      currRow++;
      document.getElementById('container').innerHTML+=
      "&lt;tr id='input"+currRow+"'&gt;&lt;td&gt;&lt;input type='text' size='2' class='c-text' name='tariff"+currRow+"' /&gt;&lt;/td&gt;&lt;td&gt;&lt;select type='text' class='c-text required' onchange=unSelect('required') name='mark"+currRow+"'  style='width:80px;' /&gt;{$dropDownc}&lt;/select&gt;&lt;/td&gt;"+
      "&lt;td&gt;&lt;select type='text' class='c-text required' onchange=unSelect('required') name='pryear"+currRow+"'  style='width:60px;'/&gt;{$dropDown8}&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;select type='text' class='c-text required' onchange=unSelect('required') name='lit"+currRow+"'  style='width:60px;'/&gt;{$dropDown10}&lt;/select&gt;&lt;/td&gt;"+
      "&lt;td&gt;&lt;select type='text' class='c-text required' onchange=unSelect('required') name='model"+currRow+"'  style='width:80px;'/&gt;{$dropDown9}&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;select type='text' class='c-text required' onchange=unSelect('required') name='weight"+currRow+"' /&gt;{$dropDown11}&lt;/select&gt;&lt;/td&gt;"+
      "&lt;td&gt;&lt;input type='text' size='2' class='c-text' id='price"+currRow+"' onkeyup='onlyNumber(this)' onkeydown='onlyNumber(this)' onchange='onlyNumber(this)' name='price"+currRow+"' /&gt;&lt;/td&gt;&lt;td&gt;&lt;input type='text' size='1' class='c-text' id='carnum"+currRow+"' onkeyup='onlyNumber(this)' onkeydown='onlyNumber(this)' onchange='onlyNumber(this)' name='carnum"+currRow+"' /&gt;&lt;/td&gt;"+
      "&lt;td&gt;&lt;input type='text' size='2' class='c-text' id='sumprice"+currRow+"' onclick='SumPrice("+currRow+")' onkeydown='onlyNumber(this)' onchange='onlyNumber(this)' name='sumprice"+currRow+"' /&gt;&lt;/td&gt;&lt;td&gt;&lt;select type='text' class='c-text required' onchange=unSelect('required') name='status"+currRow+"' /&gt;{$dropDown12}&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;";
      }
  
  
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;?php
  
  
  
      $ht="&lt;table id='container' width='100%'&gt;
      &lt;tr&gt;
      &lt;th&gt;test1&lt;/th&gt;
      &lt;th&gt;test2&lt;/th&gt;
      &lt;th&gt;test3&lt;/th&gt;
      &lt;th&gt;test4&lt;br&gt;LIT&lt;/th&gt;
      &lt;th&gt;test5&lt;/th&gt;
      &lt;th&gt;test6&lt;/th&gt;
      &lt;th&gt;test7&lt;/th&gt;
      &lt;th&gt;test8&lt;/th&gt;
      &lt;th&gt;test9&lt;/th&gt;
      &lt;th&gt;test10&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  
      &lt;input type='button' id='add' value='add new row' class='c-button' onclick='addRow()' &gt;
      ";
  
      echo $ht.'&lt;br&gt;';
  
      ?&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>