Open In App

SVG Document.image Property

Last Updated : 30 Mar, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

The SVG Document.image property returns the collection of images in the current HTML document.

Syntax:

var imageCollection = document.images

Return value: This property returns the collection of images in the current HTML document.

Example:

HTML
<!DOCTYPE html>
<html>

<body>
    <img src="https://media.geeksforgeeks.org/wp-content/
        cdn-uploads/20200817185016/gfg_complete_logo_2x-min.png">

    <svg width="700" height="500" 
        xmlns="http://www.w3.org/2000/svg">
        
        <script>
            console.log(document.images);    
        </script>
    </svg>
</body>

</html>

Output:


Similar Reads