Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
SVGRectElement インターフェイスは、 <rect> 要素のプロパティへのアクセス、およびそれらを操作するメソッドを提供します。
EventTarget Node Element SVGElement SVGGraphicsElement SVGGeometryElement SVGRectElementこのインターフェイスには、親である SVGGeometryElement から継承したプロパティもあります。
SVGRectElement.x 読取専用指定された <rect> 要素の x 属性に対応する SVGAnimatedLength を返します。
SVGRectElement.y 読取専用指定された <rect> 要素の y 属性に対応する SVGAnimatedLength を返します。
SVGRectElement.width 読取専用指定された <rect> 要素の width 属性に対応する SVGAnimatedLength を返します。
SVGRectElement.height 読取専用指定された <rect> 要素の height 属性に対応する SVGAnimatedLength を返します。
SVGRectElement.rx 読取専用指定された <rect> 要素の rx 属性に対応する SVGAnimatedLength を返します。
SVGRectElement.ry 読取専用指定された <rect> 要素の ry 属性に対応する SVGAnimatedLength を返します。
このインターフェイスは固有のメソッドを実装していませんが、親である SVGGeometryElement から継承したメソッドがあります。
この例では、ユーザーがクリックするたびに、SVGRectElement の塗りつぶしの色をランダムな値に設定します。
| Scalable Vector Graphics (SVG) 2 # InterfaceSVGRectElement |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年8月18日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.