SVGGElement in SVG 1.1
Corresponds to the <g> element for grouping together related graphics elements.
Inherits from:
For official information please see http://www.w3.org/TR/SVG11/struct.html#Groups.
Instance Methods
| name | returns | description |
|---|---|---|
| addEventListener() | (none) | [from EventTarget] |
| removeEventListener() | (none) | [from EventTarget] |
| dispatchEvent() | Boolean | Dispatches an event to the invoking object. [from EventTarget] |
Description
Grouping the elements together is useful for applying common styles to all contained elements, applying a common event handler to all child elements, or applying geometric transformations (such as a simple translation offset) to all elements at once. For example:
<g id="start" class="button" onclick="StartPlaying()" transform="translate(4cm,0cm)">
<rect width="3cm" height="1cm" />
<text x="1.5cm" text-anchor="middle" y="0.6cm">Start</text>
</g>