76
rated 0 times
[
78]
[
2]
/ answers: 1 / hits: 45753
/ 13 Years ago, tue, january 24, 2012, 12:00:00
I have defined the image tag with a background color so that if there is no image the color should show but still the broken image icon is showing how to remove that ?
I dont want to make the page bulky by adding jquery or any framework , also i cant add any kind of divs to images because the site is almost done.
Found the answer with only javascript
function ImgError(source){
source.src = /images/noimage.gif;
source.onerror = ;
return true;
}
<img src=someimage.png onerror=ImgError(this);/>
More From » html