This commit is contained in:
Israel Alves de Oliveira Arruda 2026-06-01 19:38:31 -03:00
parent 45f4b50233
commit 37d8baf771
1 changed files with 9 additions and 8 deletions

View File

@ -4,9 +4,7 @@ async function carregarProdutos(){
throw new Error("Não foi possível carregar a lista")
}
const produtos = await resposta.join();
let tbody = document.querySelector("tbody");
produtos.forEach(produto =>{
let linha = document.createElement("tr")
linha.innerHTML = `
@ -14,7 +12,10 @@ async function carregarProdutos(){
<td>${produto.preco}</td>
<td>${produto.estoque}</td>
`
tbody.appendChild
})
tbody.appendChild(linha);
});
}
window.addEventListener("load", () => {
carregarProdutos();
})