X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Image complete Property

Image Object Reference Image Object

Example

Check to see if the image is finished loading:

var x = document.getElementById("myImg").complete;

The result of x could be:

true

Try it yourself »


Definition and Usage

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

If the image is finished loading, the complete property returns true. If the image is not finished loading, this property returns false.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The complete property is supported in all major browsers.


Syntax

imageObject.complete

Technical Details

Return Value: A Boolean that indicates whether the browser is finished loading the image or not. Returns true if the loading is finished, otherwise it returns false


More Examples

Example

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

<script>
function myFunction() {
    alert("Image loaded: " + document.getElementById("myImg").complete);
}
</script>

<body onload="myFunction()">

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]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook