Let’s review what we learned:
- The DOM Interface allows you to select a specific element with CSS selectors by using the
- You can access an element directly by its ID with the
.getElementById()method which returns a single element.
- You can access an array of elements with the
.getElementsByTagName()methods, then call a single element by referencing its placement in the array.
.styleproperties allow you to modify an element by changing its contents or style respectively.
- You can create, append, and remove elements by using the
.onclickproperty can add interactivity to a DOM element based on a click event.
.childrenproperty returns a list of an element’s children and the
.parentNodeproperty returns the element’s closest connected node in the direction towards the root.
Feel free to practice what we’ve learned in this lesson. When you are ready, click “Next” to continue!