document.addEventListener('DOMContentLoaded', function () { /* copy alt text from the main image to its lazy-load duplicate */ document.querySelectorAll('img[data-orig-src][alt=""]').forEach(function (lazy) { var real = lazy.parentElement.querySelector('img:not([data-orig-src])[alt]'); lazy.alt = real && real.alt ? real.alt : ''; // decorative if none }); });