Dude, same struggle when I started! HTML is just markup—no logic. You *have* to use JS.
Try this:
```javascript
// Assuming you have a JSON file named 'data.json'
fetch('data.json')
.then(res => res.json())
.then(data => {
let output = '';
data.forEach(item => {
output += `<p>${item.name}</p>`;
});
document.body.innerHTML = output;
});
```
It’s a bit more advanced but shows how to loop through JSON.
Try this:
```javascript
// Assuming you have a JSON file named 'data.json'
fetch('data.json')
.then(res => res.json())
.then(data => {
let output = '';
data.forEach(item => {
output += `<p>${item.name}</p>`;
});
document.body.innerHTML = output;
});
```
It’s a bit more advanced but shows how to loop through JSON.
