SVGElement
所有 SVG DOM 类的父类。
属性
SVGElement.dataset(en-US)只读-
A
DOMStringMapobject which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element. These can also be defined in SVG using attributes of the formdata-* (en-US), where*is the key name for the pair. This works just like HTML'sHTMLElement.datasetproperty and HTML'sdata-*global attribute. SVGElement.id只读-
A
DOMStringrepresenting the value of theidattribute on the given element, or the empty string ifidis not present. SVGElement.xmlbase只读-
A
DOMStringcorresponding to thexml:base (en-US)attribute on the given element. SVGElement.ownerSVGElement只读-
An
SVGSVGElementreferring to the nearest ancestor<svg>element.nullif the given element is the outermost<svg>element. SVGElement.viewportElement只读-
The
SVGElement, which established the current viewport. Often, the nearest ancestor<svg>element.nullif the given element is the outermost<svg>element.
方法
SVGElement 类本身没有方法,但拥有从父类 Element 继承的方法。
规范
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2 # InterfaceSVGElement |
浏览器兼容性
BCD tables only load in the browser
相关链接
- HTML
data-*属性 - SVG
data-* (en-US)属性 - 使用数据属性