add another line 点击无反应
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TK</title>
<style>
.dataTableHeadingRow{
border: 1px solid #E8E8E8;
border-collapse: collapse;
width: 5;
}
input[type=number]{
width: 40px;
}
</style>
</head>
<body>
<tr>
<td>
<table style="" bordercolor="#000000" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<table style="width: 10px;" border="0" cellspacing="1" cellpadding="1">
<tbody>
<tr class="dataTableHeadingRow">
<th class="dataTableHeadingContent" align="left">QTY</th>
<th class="dataTableHeadingContent" align="left" width="60%"><span style="font-size: medium;">ITEM# OR DESCRIPTION</span></th>
<th class="dataTableHeadingContent" align="left" width="30%"><span style="font-size: medium;">NOTES</span></th>
</tr>
<tr class="dataTableRow">
<td class="QTY ROW" align="left"><input type="number"></td>
<td class="ITEM ROW" align="left" ><input type="text" list="product" input size="75" ></td>
<td class="NOTES ROW" align="center" width=""><input type="text" input size="40"></td>
</tr>
</tbody>
</table>
<div><input type="button" class="button" value="Add another line" onclick="addField();"></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<script type="text/javascript">
function addField (argument) {
var dataTableRow = document.getElementsByClassName("dataTableRow");
var currentIndex = "dataTableRow".rows.length;
var currentRow = "dataTableRow".insertRow(-1);
var QTY = document.createElement("input");
QTY .setAttribute("name", "QTY " + currentIndex);
var ITEM = document.createElement("input");
ITEM .setAttribute("name", "ITEM " + currentIndex);
var NOTES = document.createElement("input");
NOTES .setAttribute("name", "NOTES " + currentIndex);
var addRowBox = document.createElement("input");
addRowBox.setAttribute("type", "button");
addRowBox.setAttribute("value", "Add another line");
addRowBox.setAttribute("onclick", "addField();");
addRowBox.setAttribute("class", "button");
var currentCell = currentRow.insertCell(-1);
currentCell.appendChild(QTY);
currentCell = currentRow.insertCell(-1);
currentCell.appendChild(ITEM);
currentCell = currentRow.insertCell(-1);
currentCell.appendChild(NOTES);
currentCell = currentRow.insertCell(-1);
currentCell.appendChild(addRowBox);
}
</script>
</body>
</html>