I have following code:
K.API.Core.runWhenElementPresent('.product-media', function () {
var KamH = '<div id="KamHi"><center><div class="KamCo"><span>Test</span></div>';
document.querySelector('.product-media').insertAdjacentHTML('afterbegin', KamH);
});
K.API.Core.runWhenElementPresent is from my tool I work with and proofs if the class .product-media exists and insert "Test" at given place.
But I can change the product-media picture if I click at another color f.e.. Then an ajax call show the picture with another color (it doesn't replace the class, only the content), but my element is not there anymore.
Can you tell me, if it's possible to still show "Test" after the ajax call, and what do I have to do? jquery is not supported I think. (I'm no coder, so it would be awesome if you can give me the code I need)
Thank you