In this lesson, you manipulated a webpage structure by leveraging the Document Object Model interface in JavaScript.

Let’s review what we learned:

  • The document keyword grants access to the root of the DOM in JavaScript
  • The DOM Interface allows you to select a specific element with CSS selectors by using the .querySelector() method
  • You can also access an element directly by its ID with .getElementById()
  • The .innerHTML and .style properties allow you to modify an element by changing its contents or style respectively
  • You can create, append, and remove elements by using the .createElement(),.appendChild() and .removeChild() methods respectively
  • The .onclick property can add interactivity to a DOM element based on a click event


Click next to complete this lesson!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?