I have an HTMLCollection
that I have converted from a string:
let el = document.createElement('html');
el.innerHTML = data; // This data is my HTML string
let allArtistTiles = el.getElementsByClassName('artistTile');
console.log(allArtistTiles); // I used this to check I see the HTML Collection
let artistsPlaceholder = document.getElementById('artistsPlaceholder')
artistsPlaceholder.innerHTML = allArtistTiles
It’s the last line I’m not sure about. How do I actually show all the elements in the HTMLCollection
? Do I have to iterate through the HTMLCollection? Also, is it necessary to convert the HTMLCollection into an array?