Hi @NinoB97
The selector has been changed; I don’t understand why
Please change to it
const loop = setInterval(() => {
if(document.querySelector('.list.list-payment')) {
clearInterval(loop)
addIcon()
}
}, 100)
setTimeout(() => {
clearInterval(loop)
}, 10000)
function addIcon() {
// Create a new div element
var newDiv = document.createElement('div');
newDiv.style.display = 'flex';
newDiv.style.justifyContent = 'center';
newDiv.style.marginTop = '20px';
newDiv.style.marginBottom = '20px';
// Create a new image element
var newImg = document.createElement('img');
newImg.src='https://cdn.shopify.com/s/files/1/0787/4369/9783/files/Tekst_zonder_schaduw.png?v=1720644560';
newImg.alt = 'Product Image';
newImg.style.width = '300px';
newImg.style.height = 'auto';
// Append the image to the div
newDiv.appendChild(newImg);
// Find the element with the class "payment-icons"
var paymentIcons = document.querySelector('.list.list-payment');
// Insert the new div after the "payment-icons" element
if (paymentIcons) {
paymentIcons.parentNode.insertBefore(newDiv, paymentIcons.nextSibling);
}
}
The result
