Skip to content
Related Articles

Related Articles

SVG RectElement.ry Property
  • Last Updated : 03 Nov, 2020

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:

My Personal Notes arrow_drop_up
Recommended Articles
Page :