I am trying to showing a picture and handling the loading error, this.onerror work like fine but when a source failed to load , i can see a broken image, so how can I add error function to each source tag?
<picture>
<source srcset="images/test-480w.png" media="(max-width: 600px)" />
<source srcset="images/test-800w.png" media="(min-width: 600px)" />
<img class="lazyload" data-src="images/image.jpg" onerror="this.onerror=null;this.src='image_not_found.jpg';" style="width: 200px;height: 100px;"/>
</picture>