Engrain by ByteRush

FND.10.01 BeginnerCore — asked often

The DOM: selecting and changing elements

Comes up in: Recruiter screen, UI coding

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • what the DOM is (tree of nodes)
  • querySelector(All)
  • textContent vs innerHTML (and the XSS warning)
  • classList
  • attributes
  • createElement, append, remove

Words you will know

DOMnodeelementXSS

What you will practise

  • to-do list rendering (worked)

Interview questions this answers

  • What is the DOM?
  • What is the difference between textContent and innerHTML? Why can innerHTML be dangerous?