Horje

How to Using onload on an <img> element. Alert "Image is loaded" immediately after an image has been loaded - HTML onload Attribute

Img Example.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<img src="https://horje.com/avatar.png" onload="loadImage()" width="100" height="132">

<script>
function loadImage() {
  alert("Image is loaded");
}
</script>

</body>
</html>

Output should be:

How to Using onload on an <img> element. Alert "Image is loaded" immediately after an image has been loaded - HTML onload Attribute




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