Hour 12. Scripting the DOM
What You’ll Learn in This Hour
• How to create new elements
• Ways to add, edit, and remove child nodes
• Changing element attributes
When you amend the DOM using the methods described in this hour, you change the way a page appears in the browser. Bear in mind, though, that you’re not changing the document itself. If you ask your browser to display the source code of the page, you won’t see any changes there.
That’s because the browser is actually displaying the current DOM representation of the document. Change that, and you change what appears onscreen.
In the previous hour, you learned how to navigate the DOM tree to select specific nodes (or collections of nodes) and ...