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

Changing Content

Changing Content

After accessing a node, you can change its content by assigning a new value to it.

<!DOCTYPE html>
<html>
 <head>
   <script>
     function go() {
       "use strict";
       const p = document.getElementById("p2");
       p.innerHTML = "Another text";
     }
   </script>
 </head>
 <body id="body">
   <p id="p1" style="background: aqua">one</p>
 ...