In this chapter, you created a small application that allows you to add and edit SVG elements on a target SVG canvas. Working your way through this application, you learned about a wide variety of DOM features and functionality, including:
- Two different ways to access DOM elements, using document.getElementById and document.querySelectorAll
- How to insert SVG elements using document.createElementNS and appendChild
- How to bind events to HTML and SVG elements using addEventListener
- How to get, set, and remove CSS classes from an SVG element using the classList interface
- How to manipulate common SVG properties using getAttribute and setAttribute
- How to convert between the browser coordinate system and the SVG element coordinate system by using the getScreenCTM method to get the inverse of the Current user unit Transformation Matrix
- How to set the text content of an SVG...