SVGCircleElement: r 属性
SVGCircleElement 接口的只读属性 r 反映了 <circle> 元素的 r 属性,从而定义了圆的半径。
如果未指定,则效果如同将值设置为 0。
值
一个表示圆半径的 SVGAnimatedLength 对象。
示例
SVG
html
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
width="200"
height="200">
<circle r="50" fill="gold" id="circle" />
</svg>
JavaScript
js
const circle = document.getElementById("circle");
console.log(circle.r);
规范
| 规范 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGCircleElement__r |
浏览器兼容性
加载中…