HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
HTML Event Attributes : Execute a JavaScript if an error occurs when loading an image
The onerror attribute fires when an error occurs while loading an external file (e.g. a document or an image).
Event Attribute | |||||
---|---|---|---|---|---|
onerror | Yes | Yes | Yes | Yes | Yes |
Value | Description |
---|---|
script | The script to be run on onerror |
Supported HTML tags: | <img>, <input type="image">, <object>, <link>, and <script> |
---|
HTML DOM reference: onerror event
❮ HTML Event Attributes