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

Change the Content

We use the example of a paragraph (<p>). To change its content (the text), simply assign a new value to its innerHTML. function show() { "use strict"; const elem = document.getElementById("p1"); elem.innerHTML = "New text in the paragraph."; } Or, to do the same with a different HTML element, we can change the SVG graphic: function show() { "use strict"; const elem = documen...