The following example illustrates the basic mechanism of using events within the SVG DOM to generate new objects and append them into the DOM.
|Inserting new objects into the SVG DOM|
The above code takes the coordinate of the mouse click (evt.clientX,evt.clientY) and generates an ellipse centered at that point. The color is chosen cyclically from an array. The ellipse is then appended to the Root of the document (the target of the onload evt).