Open In App

SVG CircleElement.cy Property

Improve
Improve
Like Article
Like
Save
Share
Report

The SVG CircleElement.cy property returns an SVGAnimatedLength object corresponding to the attribute of the given line element.

Syntax:

CircleElement.cy

Return value: This property returns SVGAnimatedLength object that can be used get the cy of the circle element

Example 1: 

HTML




<!DOCTYPE html>
<html>
  
<body>
    <svg xmlns="http://www.w3.org/2000/svg" 
         viewBox="0 0 250 250" width="250" height="250">
      <circle cx="150" cy="100" r="50" fill="green" 
              id="gfg" onclick="clickCircle();"/>
      <script>
        var g = document.getElementById("gfg");
                console.log(g.cy)
      </script>
    </svg>
</body>
  
</html>


Output:

Example 2: 

HTML




<!DOCTYPE html>
<html>
  
<body>
    <svg xmlns="http://www.w3.org/2000/svg" 
         viewBox="0 0 250 250" width="250" height="250">
      <circle cx="150" cy="160" r="50" fill="green" 
              id="gfg" onclick="clickCircle();"/>
      <script>
        var g = document.getElementById("gfg");
                console.log(g.cx)
      </script>
    </svg>
</body>
  
</html>


Output:



Last Updated : 30 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads