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
Alternative Syntax
Attributes can also be modified using a different syntax:
element_name.attribute_name = "new value";
For example, in the previous example, we can change the link as follows:
anchor.href = "https://www.example.com";
// Instead of using:
// anchor.setAttribute("href", "https://www.example.com");