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
anddocument.querySelectorAll
- How to insert SVG elements using
document.createElementNS
andappendChild
- 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
andsetAttribute
- 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 text element using
textContent
Together with the lessons you've already learned in this book, the lessons you learned in this...