0
for (var i = 0; i < itemNumber.length; i++) {
tableres += '< tr>';
tableres += '<td>' + itemNumber[i] + '</td>';
tableres += '<td>' + itemName[i] + '</td>';
tableres += '<td>' + itemType[i] + '</td>';
tableres += '<td>' + itemDesc[i] + '</td>';
tableres += '<td>' + itemStock[i] + '</td>';
tableres += '<td>' + itemPrice[i] + '</td>';
tableres += '</tr>';
}
tableres += '< /table>';
在此代码中,在itemType中有5种不同的类型。我想用我保存的图像来替换此类型。我该怎么做呢?如何使用JavaScript添加图像
不同的类型是 - 电子,时尚,体育用品,娱乐,玩具。
这些也是项目类型的值。
添加图片标签?问题是模糊的。 – epascarello
图片网址如何?这些类型有什么价值? – Bergi
不要忘记修复(删除)'< tr>'和'< /table>'标签中的空白。 – Bergi