Search w3schools.com:

SHARE THIS PAGE

Image complete Property

Image Object Reference Image Object

Definition and Usage

The complete property returns whether or not the browser is finished loading an image.

If the image is finished loaded, the complete property returns true, otherwise it returns false.

Syntax

imageObject.complete


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The complete property is supported in all major browsers.


Example

Example

Check to see if the image is finished loaded on body onload:

<html>
<head>
<script>
function alertComplete()
{
alert("Image loaded: " + document.getElementById("compman").complete);
}
</script>
</head>
<body onload="alertComplete()">

<img id="compman" src="compman.gif" alt="Computerman">

</body>
</html>

Try it yourself »


Image Object Reference Image Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]