This is my whole script file (baseURL not shown) which returns 6 objects upon the request on page load (which can be verified if console.log(tabooObject) is used).
My issue is that it's not rendering the 6 div's (tabooObject) on my page, rather it's just HTML written out with the name values, instead of the divs actually being rendered. In other words, I see: <div class="col"> <div class="name">Hey You!</div>...
in my browser.
const tabooWidget = document.querySelector('.taboo.widget'); //parent div
fetch(`${baseURL}`)
.then(response => response.json())
.then(data => {
for(let i = 0; i < data.list.length ; i++){
let name = data.list[i].name;
let tabooObject = `
<div class="col">
<div class="name">${name}</div>
</div>`;
tabooWidget.append(tabooObject);
}
})
.catch(error => console.error(error))