Passing information back and forth between SVG and HTML
While some good books on SVG have begun to appear proportionally little space seems to have been devoted to the interaction between HTML and SVG through JavaScript.
However, there are plenty of good reasons for wanting to do this:
A. Embedding SVG in HTML documents
Placing an SVG object into a web page is typically done with an <embed> tag.
Although, we may also use <object> or <iframe> tags to include SVG content into an HTML document, neither seems (based on natural experiments) to allow for the subsequent traversal of the SVG DOM by JavaScript within the HTML. It is possible, over time, that the <object> may become a preferrable approach since it enjoys greater standards support from the WWW Consortium. Though as of this writing, there appears to be no way of interrogating the contents of an <object> tag.Example of embedding SVG into an HTML document
Here is an ordinary web page with an SVG embed that is resized and repositioned