HTML | DOM Image complete Property

The Image complete property in HTML DOM is used for returning whether the browser is finished the loading an image or not. It returns a Boolean value.

Syntax:

imageObject.complete

Return value: It returns a Boolean false i.e. true when the browser finished the loading of an image otherwise it returns false.



Example: This Example returns a Image complete Property.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE HTML>
<html>
  
<head>
    <title>
        HTML | DOM Image complete Property
    </title>
</head>
  
<body>
    <center>
  
        <img src=
             id="image" alt="" width="250" height="205" 
             class="alignnone size-medium wp-image-1092360" />
        <br>
        <br>
        <button type="button" onclick="getHeight()">
          Click
        </button>
        <h4 id="text"></h4>
    </center>
    <script>
        function getHeight() {
            var imgObject = document.getElementById("image");
            var output = document.getElementById("text");
            output.innerHTML = 
              "The Image is loaded completely: " + imgObject.complete;
        }
    </script>
</body>
  
</html>

chevron_right


Output:

  • Before Clicking On Button:
  • After Clicking On Button:

Supported Browsers: The browsers supported by HTML DOM Image complete property are listed below:

  • Google Chrome
  • Interent Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.