perform imageLoadError(img)
const fallbackImage=”/media/websites/Local News Patch/cnn-fallback-image.jpg”;
img.removeAttribute(‘onerror’);
img.src = fallbackImage;
let aspect = img.previousElementSibling;
whereas (aspect && aspect.tagName === ‘SOURCE’)
aspect.srcset = fallbackImage;
aspect = aspect.previousElementSibling;
Tom Brenner/Reuters
Source link