Chapter 16. Animating SVG with Scripting

In Chapter 15, “Scripting SVG,” you saw how to modify SVG—from within SVG (or embedded script code). This chapter features techniques to access HTML data from within SVG and vice versa. We will also look at ways to animate SVG using client-side ECMAScript/JavaScript.

HTML and SVG Interaction

If you know JavaScript, you probably know how to change HTML content—from within HTML (or embedded script code). In this chapter, we go over the border and access HTML data from within SVG and vice versa.

From SVG to HTML

In JavaScript terms, the most important objects for accessing HTML data are the following two:

  • The document object represents the HTML document, ...

Get SVG Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.