Week 4 Reveiw Flashcards

1
Q

A standardized way to define a web page’s structure

A

DOM Document Object Model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

DOM represents a web page as a _________ of objects

A

hierarchy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

DOM objects have _________ and ___________.

A

properties methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

__________________ is the langauage of choise for dealing with the DOM

A

JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Two types of nodes

A

elements and texts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The document variable matches the ______ element

A

HTML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

code to visit the child node of a page

A

document.body.childNodes[0]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

child nodes include __________ lines

A

blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

method to get an element by its HTML tag

A

getElementsByTagName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

method to get elements by its HTML class

A

getElementsByClassName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

method to get an element by its ID

A

getElementById()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

to create an array from getElements return use function

A

Array.from()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

method to get the first node with CSS selector

A

querySelector()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

method to get all nodes with CSS selector

A

querySelectorAll()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

property of a node to get its inner HTML content

A

innerHTML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

property of a node that gets the text content

A

textContent

17
Q

method to get the attribute of a node

A

getAttribute()

18
Q

method to determine if a node has an attribute

A

hasAttribute()

19
Q

method to get elements by its HTML tag name attribute

A

getElementsByTagName()

20
Q

method to get elements by the class name

A

getElementsByClassName()

21
Q

property to change the content of an element within the DOM

A

innerHTML

22
Q

use innerHTML to delete content

A

.innerHTML = “”

23
Q

add a change to the text of a node

A

.textContent +=

24
Q

set a name attribute of a node to “Jeff”

A

.setAttribute(“name”,”Jeff”)

25
Q

property used to add or remove classes from a DOM element

A

classList

26
Q

3 steps to add a new element to a web page

A
  1. create a new Element
  2. Set element properties
  3. Inset new element into the DOM