0

Hello I can change my image to other image if it has no image.

<img src="test.png" onerror="if (this.src != 'pic_back.png') this.src = 'pic_back.png';" width="80" >

but I don't know how to hide the other image if it has no other image too. (if not have both main image and alternate image, then I want to use css display:none)

I know how to hide image but in this case, the onerror event has change to other image already, so I cannot use the onerror event again? so it's not duplicate

doflamingo
  • 567
  • 5
  • 23
  • 2
    Possible duplicate of [How to silently hide "Image not found" icon when src source image is not found](http://stackoverflow.com/questions/3235913/how-to-silently-hide-image-not-found-icon-when-src-source-image-is-not-found) – Taha Paksu Mar 24 '17 at 06:52
  • I know how to hide image but in this case, the onerror event has change to other image already, so I cannot use the onerror event again? so it's not duplicate – doflamingo Mar 24 '17 at 06:54
  • Are you talking about the flashing missing image? – Manngo Mar 24 '17 at 07:01

0 Answers0