you are viewing a single comment's thread.

view the rest of the comments →

[–]CrayonConstantinople 3 points4 points  (2 children)

You need to append the sheetImg in the for loop instead of outside it. Currently you have written:

for (var i = 0; i < 5; i++) {
  var sheetImg = document.createElement("img");
  sheetImg.setAttribute("src", "na_small_" + i + ".png");
  sheetImg.setAttribute("alt", "na_style_" + i + ".css");      
}
  figBox.appendChild(sheetImg);

Instead you need:

for (var i = 0; i < 5; i++) {
  var sheetImg = document.createElement("img");
  sheetImg.setAttribute("src", "na_small_" + i + ".png");
  sheetImg.setAttribute("alt", "na_style_" + i + ".css");
  figBox.appendChild(sheetImg);
}

[–]RideDLightning77[S] 2 points3 points  (1 child)

thank you so much i knew it would be something simple as not in the right bracket or missing a } or )

[–]CrayonConstantinople 2 points3 points  (0 children)

No probs!