Hi I'am trying to build table with js, but I'am not able to force it to build in specific div it always create my table outside entire section. Is there any way to force it?
HTML:
<section class="all-products" id="all-products">
<div class="container">
<div class="title-box">
<h2>Products</h2>
</div>
<div class="row" id=products-row">
<script>
LoadAllProducts();
</script>
</div>
</div>
</section>
load-products.js:
function LoadAllProducts() {
var x = document.createElement("TABLE");
x.setAttribute("id", "table");
document.body.appendChild(x);
var y = document.createElement("TBODY");
y.setAttribute("id", "products");
document.getElementById("table").appendChild(y);
}