33

Creating and Removing DOM Elements

In this Chapter

  • Understand how easy it is to use JavaScript to create DOM elements from nothing

  • Learn how to clone existing DOM elements as well as remove DOM elements you no longer want

This part may blow you away. For the following sentences, I suggest you hold onto something sturdy:

images

Despite what our earlier discussions about the DOM may have led you to believe, our DOM does not have to be made up of HTML elements that exist in markup. We have the ability to create HTML elements out of thin air and add them to our DOM using just a few lines of JavaScript. We also have the ability to move elements ...

Get Javascript Absolute Beginner's Guide, 3rd Edition 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.