Default image settings when the img tag fails to load

<img src="abc.jpg" οnerrοr="οnerrοr=null;src='123.jpg'" />




Add to the img tag onerror="onerror=null;src='123.jpg'" , that is, when the image fails to load  , it will be automatically loaded 123.jpg, for example

Reference: https://segmentfault.com/a/1190000005958514



Guess you like

Origin blog.csdn.net/zwx_lucky/article/details/79748823