Horje

Example of HTML onerror Event Attribute

It will alert that an error occured while loading the video.
index.html
Example: HTML

<!DOCTYPE html>
<html>
<head> <title>onerror event attribute</title> <style> body { text-align: center; } h1 { color: green; } </style>
</head>
<body> <img src=
"https://horje.com/avatar.png" onerror="myFunction()"> <h1>Horje</h1> <h2>onerror event attribute</h2> <script> function myFunction() { console.log("The image could not be loaded") } </script>
</body>
</html

Output should be:

Example of HTML onerror Event Attribute



Single Articles
Example of HTML onerror Event Attribute HTML Media Events Attribute
Definition and Usage of HTML onerror Event Attribute HTML Media Events Attribute
Browser Support of HTML onerror Event Attribute HTML Media Events Attribute
Syntax of HTML onerror Event Attribute HTML Media Events Attribute
Attribute Values of HTML onerror Event Attribute HTML Media Events Attribute
Technical Details of HTML onerror Event Attribute HTML Media Events Attribute


Related Articles
List of Media Events HTML Media Events Attribute
HTML onabort Event Attrribute HTML Media Events Attribute
HTML oncanplay Event Attribute HTML Media Events Attribute
HTML oncanplaythrough Event Attribute HTML Media Events Attribute
HTML ondurationchange Event Attribute HTML Media Events Attribute
HTML onended Event Attribute HTML Media Events Attribute
HTML onerror Event Attribute HTML Media Events Attribute
HTML onloadeddata Event Attribute HTML Media Events Attribute
HTML onloadedmetadata Event Attribute HTML Media Events Attribute
HTML onloadstart Event Attribute HTML Media Events Attribute

Type :
html
Category :
Web Tutorial
Sub Category :
HTML Media Events Attribute
Uploaded by :
Admin