Image complete property
Definition and Usage
complete
The property returns whether the browser has finished loading the image.
If the image has been fully loaded then complete
The property returns true. Otherwise, this property returns false.
Instance
Example 1
Check if the image has been fully loaded:
var x = document.getElementById("myImg").complete;
Example 2
Check if the image has been fully loaded in body onload:
<script> function myFunction() { alert("Image loaded: " + document.getElementById("myImg").complete); } </script> <body onload="myFunction()">
Syntax
imageObject.complete
Technical details
Return value: | Boolean value, indicating whether the browser has finished loading the image. If loaded, it returns true, otherwise it returns false. |
---|
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |