var length = document.getElementById('envTable').rows.length;
var list = [];
for (var i = 1; i < length; i++) {
var key = document.getElementById('envTable').rows[i].cells[0].innerHTML;
var value = document.getElementById('envTable').rows[i].cells[1].innerHTML;
list.push({
key: key,
value: value
})
}
let data = JSON.stringify(list);
js遍历Table
最新推荐文章于 2023-12-15 13:34:05 发布