Hey! I’m trying to get images from a list to display at a different part of the page.
I got as far as using querySelectorAll() to create a node list element , but extracting the background-image:url got me stuck.
window.addEventListener('block-loaded-imgs', function ()
{
const images = [];
setTimeout(() =>
{
const listItems = document.querySelectorAll('#imgs *');
// for listItems.getElementsByClassName('static-image');
console.log("staticImages " +document.querySelectorAll('staticImage'))
let text = $(this).text();
const listArray = Array.from(listItems)
// console.log (listArray[9].getElementsByClassName("static-image"));
for (const image of listArray)
{
image.getElementsByClassName('static.image')
console.log("--")
console.log(image.attr)
console.log("-")
}
},1000);
});
Can anybody point me in the right direction?