Study Guide: The DOM & Events

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering DOM manipulation, selectors, element properties, events, and common errors from Cycle 10.

20 Terms

1
New cards

document

The whole page, as JavaScript sees it. It sits at the top of the element tree.

2
New cards

element

One tag on the page and everything inside it.

3
New cards

id

Names one element on the page.

4
New cards

class

An identifier that can sit on many elements.

5
New cards

selector

The same selectors you wrote in CSS: #id, .class, a tag, or nav a.

6
New cards

getElementById

Finds the element with that id. The id goes in quotes, with no #.

7
New cards

querySelector

Takes a selector and hands you the first element that matches.

8
New cards

null

What you hold when nothing matched. Using it gives a red row.

9
New cards

textContent

The words inside an element. Setting it changes the page.

10
New cards

classList.add / classList.remove

Turn a class on or off. PAGE STYLE says what the class looks like.

11
New cards

className

Every class the element has, as text. Use it to log the classes.

12
New cards

style

One look set right on the element: style.color = "darkred";

13
New cards

event

Something that happens on the page, like a click, that the browser tells your code about.

14
New cards

listener

What addEventListener sets up: it waits for one event on one element.

15
New cards

handler

The function that runs when that event happens.

16
New cards

input event

Fires every time the text in a box changes, once per key.

17
New cards

.value

What is typed in a box. It is always a string.

18
New cards

Number()

Turns a string like "12" into the number 1212.

19
New cards

Cannot read properties of null

A red row error that occurs when you use an element you never found.

20
New cards

if / else if / else

A conditional statement where checks run top to bottom, using === for equals, and only the first true branch runs.