I need to display about 20 images in my web app and they all in the content folder
I don't what to write <img src='content/image_name.png'> for every image in HTML
is there is a way to loop through all images in one folder with only java Script?
i expect something like:
folder = //i don't know what to write
const body = document.body
folder.forEach(file => {
const photo = document.createElement('img')
photo.setAttribute('src',`content/${file}` )
body.append(photo)
})
I did something like that in python using os.listdir() but i don't whon how to do it with js