0

It's add row in first row table I want add to last of rows

<script>
function addfunction(){
  var table = document.getElementById("mytable");
  var row = table.insertRow(2);
  var cell1 = row.insertCell(0);
  var cell2 = row.insertCell(1);
  var cell3 = row.insertCell(2);
  var cell4 = row.insertCell(3);
  var cell5 = row.insertCell(4);

  cell1.innerHTML = "<input type='number' disabled>";
  cell2.innerHTML = "<input type='number' name='price'>";
  cell3.innerHTML = "<input type='number' name='count'>";
  cell4.innerHTML = "<input type='text' disabled>";
  cell5.innerHTML = "<input type='text' name='barcode' onChange='addfunction()'>";
}
</script>
Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
BehnamHesami
  • 55
  • 1
  • 9
  • Possible duplicate for http://stackoverflow.com/questions/18333427/how-to-insert-row-in-html-table-body-in-javascript – Garry May 07 '15 at 08:01
  • possible duplicate of [How to insert row at end of table with HTMLTableElement.insertRow](http://stackoverflow.com/questions/15866451/how-to-insert-row-at-end-of-table-with-htmltableelement-insertrow) – Brad Koch May 09 '15 at 13:56
  • Welcome to StackOverflow! Questions like this often have an answer already, try checking this one: http://stackoverflow.com/a/15866688/425313 – Brad Koch May 09 '15 at 13:57

0 Answers0