Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

how to populate a grid with images in html

const gridContainer = document.querySelector('.grid-container');
for (let i = 1; i < 101; i++) {
  const img = document.createElement('img');
  img.src = `path-to-img/seperate-${i}.png`;
  gridContainer.append(img);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #populate #grid #images #html
ADD COMMENT
Topic
Name
6+3 =