I have a set of image links and I want to turn them into an image using JavaScript and the links are dynamic which are coming from an API. So how can I turn those links into an image. I want all the images to show for example: I have 7 image URLs so I want all the 7 URLs to get turned into an image and not only 1
The links are in a div like:
<div class="avatar"></div>
And the data is coming by an API using JS:
const getimage = () => {
axios
.get(
"https://api.github.com/repos/owner/repo/contributors"
)
.then((response) => {
const users = response.data;
console.log(users)
const avatar = document.querySelector(".avatar")
avatar.innerHTML=users.map((u) => u.avatar_url).join("<br />");
})
.catch((error) => console.error(error));
};
getimage();
How can I do that