0

On my website, there is an <img /> element without src attribute. It's src is set dynamically with Javascript after a while. In chrome, it is hidden, but in firefox it shows me up this:

image brack

Is here any way how to get rid of this via any HTML attribute or even CSS? I could do this with JS to append this img element after loading image or changing image.

can I do it with something easier than with JS?

Sender
  • 6,660
  • 12
  • 47
  • 66
Patrik Krehák
  • 2,595
  • 8
  • 32
  • 62

1 Answers1

2

As found in another answer: LINK

<img src="Error.src" onerror="this.style.display='none'"/>

Edit I know it is still javascript, but the easiest solution I've found.

Community
  • 1
  • 1
wrxsti
  • 3,434
  • 1
  • 18
  • 30
  • Thanks! Long time ago I found that `onerror` event, but I was unable to find that question on google again. Great, haven't tested yet, but I think it will works. – Patrik Krehák Nov 25 '15 at 14:21