<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="../css/reset.css">
<link rel="stylesheet" href="../css/index.css">
</head>
<body>
<main>
<section class="container">
<table>
<thead>
<tr>
<th>Descrição</th>
<th>valor</th>
</tr>
</thead>
<tbody id="produtos">
<tr class="caixa">
<td>Monitor LCD</td>
<td class="info-valor">150.00</td>
</tr>
<tr class="caixa">
<td>Teclado</td>
<td class="info-valor">32.00</td>
</tr>
</tbody>
<tfoot>
<tr class="total">
<th>Total</th>
<th class="info-total">0</th>
</tr>
</tfoot>
</table>
</section>
</main>
<script>
var listTr = document.querySelectorAll('.caixa')
console.log(listTr);
for (i = 0; i < listTr.length; i++) {
list = listTr[i];
console.log(list);
var tdValor = list.querySelector('.info-valor')
var valor = tdValor.textContent
var resultado = document.querySelector('.info-total')
var total = valor
resultado.textContent = total
console.log(total);
}
</script>
</body>
</html>