0
我如何訪問錶行的單元格(JQuery的)如何訪問表的單元格中的jQuery
for(i=0; i<6; i++)
{
if(document.getElementById(myData[i]).value !=0)
{
var nameInput = document.getElementById(myData[i]).name;
var Quan = document.getElementById(myData[i]).value;
//Create a new row with an ID
var newRow = $('<tr />').attr('id', 'row' + rowNumber);
//Add some HTML to the row
newRow.html('<td>' + nameInput + '</td><td>' + Quan + '</td>');
//Append the new row to the body of the #myTable table
$('#myTable tbody').append(newRow);
//Iterate row number
rowNumber++;
}
}
我動態創建表,並想使用單元格的前一個值添加到新單元格中。你能指導如何做到這一點?