1/19
Vocabulary practice flashcards covering DOM manipulation, selectors, element properties, events, and common errors from Cycle 10.
document
The whole page, as JavaScript sees it. It sits at the top of the element tree.
element
One tag on the page and everything inside it.
id
Names one element on the page.
class
An identifier that can sit on many elements.
selector
The same selectors you wrote in CSS: #id, .class, a tag, or nav a.
getElementById
Finds the element with that id. The id goes in quotes, with no #.
querySelector
Takes a selector and hands you the first element that matches.
null
What you hold when nothing matched. Using it gives a red row.
textContent
The words inside an element. Setting it changes the page.
classList.add / classList.remove
Turn a class on or off. PAGE STYLE says what the class looks like.
className
Every class the element has, as text. Use it to log the classes.
style
One look set right on the element: style.color = "darkred";
event
Something that happens on the page, like a click, that the browser tells your code about.
listener
What addEventListener sets up: it waits for one event on one element.
handler
The function that runs when that event happens.
input event
Fires every time the text in a box changes, once per key.
.value
What is typed in a box. It is always a string.
Number()
Turns a string like "12" into the number 12.
Cannot read properties of null
A red row error that occurs when you use an element you never found.
if / else if / else
A conditional statement where checks run top to bottom, using === for equals, and only the first true branch runs.