Class 1/22 Flashcards

1
Q

What is the DOM?

A

The DOM is a W3C (World Wide Web Consortium) standard.

The DOM defines a standard for accessing documents:

“The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document.”

The W3C DOM standard is separated into 3 different parts:

Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents

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

What does document.querySelector() return?

A

Returns the first matching Element node within the node’s subtree. If no matching node is found, null is returned.

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

How do you modify the text of elements on the DOM?

A

The textContent property of the Node interface represents the text content of the node and its descendants. .textContent

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

What arguments does the addEventListener method take?

A

an event and a function (click, myClickFunction)

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

Give five examples of JavaScript events that can be listened for.

A

click, mousemove, contentload, mouseover, keydown

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

What does document.createElement() take as its argument?

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