Open In App

SVG RectElement.ry Property

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

The SVG RectElement.ry property is used to return an SVGAnimatedLength object corresponding to the attribute of the given rectangle element.

Syntax:

RectElement.ry

Return Value: This property returns an SVGAnimatedLength object that can be used to get the "ry" value and other properties of the rectangle element.

Example 1: 

HTML
<!DOCTYPE html>
<html>

<body>
    <h1 style="color: green">
        GeeksforGeeks
    </h1>
    
    <h3>SVG RectElement.ry property</h3>
    
    <svg width="300" height="300" 
        xmlns="http://www.w3.org/2000/svg">
        
        <rect width="100" height='190' 
            fill="green" id="gfg" rx=10 ry=30 />
            
        <script>
            var g = document.getElementById("gfg");
            console.log(g.ry)
        </script>
    </svg>
</body>

</html>

Output:

Example 2: 

HTML
<!DOCTYPE html>
<html>

<body>
    <h1 style="color: green">
        GeeksforGeeks
    </h1>
    
    <h3>SVG RectElement.ry property</h3>
    
    <svg width="300" height="300" 
        xmlns="http://www.w3.org/2000/svg">
        
        <rect width="100" height='190' 
            fill="green" id="gfg" rx=10% ry=35% />
            
        <script>
            var g = document.getElementById("gfg");
            console.log(g.ry)
        </script>
    </svg>
</body>

</html>

Output:


Explore