Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <p>Assign an "onerror" event to an img element.</p> <img src="image.gif" onerror="myFunction()"> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = "The image could not be loaded."; } </script> </body> </html>