Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 9: Understanding the Document Object Model (DOM) with JavaScript!

Instruction

Modifying the Tree Structure

JavaScript can manipulate the structure of the DOM tree.

<!DOCTYPE html>
<html>
 <head>
   <script>
     function go() {
       "use strict";
       // read 'body' node
       const b = document.getElementById("body");
       // read second 'p' node
       const p = document.getElementById("p2");
       // move it to the end of 'body'
       b.appendChild(p);
     }
   </...