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 |
瀏覽器相容性
載入中…