How can I show the image in the table knowing its name?
I explain better; I have a table with three fields, id, title and image. In the image I am shown the name. but I need the image to be shown.
How can I fix this?
let table = document.getElementById("my-table");
var xmlhttp = new XMLHttpRequest();
var url = "https://r2f5k3e89j.execute-api.us-east-2.amazonaws.com/articles";
xmlhttp.onreadystatechange = function () {
var innerXmlhttp;
if (this.readyState == 4 && this.status == 200) {
var allart = JSON.parse(this.responseText);
console.log(allart);
allart.Items.forEach(item => {
let child = document.createElement("tr");
child.innerHTML = `
<td>${item.id}</td>
<td>${item.title}</td>
<td>${item.image}</td>`;
table.appendChild(child);
})
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
<table id="my-table" width="90%">
<tr>
<th>Id</th>
<th>Title</th>
<th>Image</th>
</tr>
</table>