Using onload on an <img> element. - Javascript DOM Event

Javascript examples for DOM Event:onload

Description

Using onload on an <img> element.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<img src="http://java2s.com/resources/a.png" onload="loadImage()" width="100" height="132">

<script>
function loadImage() {/*from w w w .j a  va  2s.  c  o  m*/
    console.log("Image is loaded");
}
</script>

</body>
</html>

Related Tutorials