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
Removing Attributes
Attributes are removed using the removeAttribute function. To delete the href attribute from the <a> element in the following example:
<a id="anchor" href="https://en.wikibooks.org">Wikibook</a>
The JavaScript code is:
// Get element
const anchor = document.getElementById("anchor");
// Remove attribute
anchor.removeAttribute("href");
The element its...