Is there any way to render a default image in an HTML tag, in case the src attribute is invalid (using only HTML)? If not, what would
If you're using Angular/jQuery then this might help...
Explanation
Assuming that item has a property url that might be null, when it is then the image will show up as broken. That triggers execution of onerror attribute expression, as described above. You need to override the src attribute as described above, but you will need jQuery to access your altSrc. Couldn't get it to work with vanilla JavaScript.
Might seem a little hacky but saved the day on my project.