我是 JavaScript 的新手。我有一个函数应该循环相同的图像和文本 26 次。并像多段图像和文本一样显示它们。然而,我的循环与文本和图像重叠,如下所示。
我希望我的代码显示如下所示的图像。
我怎样才能解决这个问题?我的 JavaScript 代码看起来像这样
function getData() {
var stringData = '';
for (i = 0; i < 26; i++) {
stringData = stringData + '<div><image src="img/sample-image.png" width="10% "height="10%" align="left" border="0"/>' + 'In this example a sample of the album photo on the site shall appear alongside a simple description of the album. To view the album select the album.</div><br/>';
}
document.getElementById("list-menu").innerHTML = '' + stringData + '';
}