--- title: SVGElement slug: Web/API/SVGElement translation_of: Web/API/SVGElement ---
{{InheritanceDiagram}}
*
is the key name for the pair. This works just like HTML's {{domxref("HTMLElement.dataset")}} property and HTML's {{htmlattrxref("data-*")}} global attribute.id
is not present.null
if the given element is the outermost <svg>
element.null
if the given element is the outermost <svg>
element.SVGElement
类本身没有方法, 但拥有从父类{{domxref("Element")}}继承的方法.
Specification | Status | Comment |
---|---|---|
{{SpecName("SVG2", "types.html#InterfaceSVGElement", "SVGElement")}} | {{Spec2("SVG2")}} | Adds the {{domxref("SVGElement.dataset", "dataset")}} property. |
{{SpecName("SVG1.1", "types.html#InterfaceSVGElement", "SVGElement")}} | {{Spec2("SVG1.1")}} | Initial definition |
{{ CompatibilityTable }}
Feature | Chrome | Edge | Firefox (Gecko) | Microsoft Edge | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}}[1] | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatIE("9.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
dataset attribute |
{{CompatChrome("54")}} | {{CompatUnknown}} | {{CompatGeckoDesktop("51")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatOpera("41")}} | {{CompatSafari("10.0")}} |
Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatVersionUnknown}}[1] | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} [1] |
dataset attribute |
{{CompatNo}} | 54 | {{CompatUnknown}} | {{CompatGeckoMobile(51)}} | {{CompatUnknown}} | 41 | 10.0 | 54 |
[1] 属性 offsetParent
, offsetTop
, offsetLeft
, offsetWidth
, 和 offsetHeight
从Chrome 48开始被废弃.