files/en-us/web/api/svgellipseelement/index.md
{{APIRef("SVG")}}
The SVGEllipseElement interface provides access to the properties of {{SVGElement("ellipse")}} elements.
{{InheritanceDiagram}}
Inherits methods from its parent interface, {{domxref("SVGGeometryElement")}}.
Inherits methods from its parent interface, {{domxref("SVGGeometryElement")}}.
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="100" cy="100" rx="100" ry="60" id="ellipse" />
</svg>
const ellipse = document.getElementById("ellipse");
function outputSize() {
// Outputs "horizontal radius: 100 vertical radius: 60"
console.log(
`horizontal radius: ${ellipse.rx.baseVal.valueAsString}`,
`vertical radius: ${ellipse.ry.baseVal.valueAsString}`,
);
}
ellipse.addEventListener("click", outputSize);
{{EmbedLiveSample("Example", 220, 220)}}
{{Specifications}}
{{Compat}}