There is an array of url-lok. It is necessary to collect img tags by the number of urls in the array. The img tag should contain the class "tableBanner1".

Here is an example array:

var masive_picture = ["https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Proton-K-Zarya.jpg/800px-Proton-K-Zarya.jpg", "https://upload.wikimedia.org/wikipedia/ru/3/31/Winniethepooh.jpg" ] 

And you need to get it:

 <img class="tableBanner1" src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Proton-K-Zarya.jpg/800px-Proton-K-Zarya.jpg" /> <img class="tableBanner1" src="https://upload.wikimedia.org/wikipedia/ru/3/31/Winniethepooh.jpg" /> 

I know that I need to go through the array with a chunk, but I don’t know how it should look syntactically. Tell me who knows how to do it ..

    1 answer 1

    One of the methods

     var text = ''; for (var i = 0; i < masive_picture.length; ++i) { text += '<img class="tableBanner1" src="' + masive_picture[i] + '" />' } 

    You can create an img tag dynamically in javascript. But then you will need to explicitly specify the container, where to add all this