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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.