Javascript examples for DOM HTML Element:Image
The complete property returns whether or not the image is loaded.
A Boolean that indicates whether the browser is finished loading the image.
The following code shows how to Check to see if the image is finished loading:
<!DOCTYPE html> <html> <head> <script> function myFunction() {//from w w w . ja v a 2 s. com console.log("Image loaded: " + document.getElementById("myImg").complete); } </script> </head> <body onload="myFunction()"> <img id="myImg" src="http://java2s.com/resources/a.png" alt="alt message" width="107" height="98"> </body> </html>