1.3 - The DOM Flashcards

1
Q

En qué nos ayuda el DOM

A

Nos permite interactuar con un document HTML

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

Técnicamente, que es el DOM

A

es una API por cada HTML, como también documentos XML, y SVG. Nos ofrece una representación en forma de objetos en un árbol

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

With the DOM, programmers can… ?

A

Build documents Navigate their structure Add, modify, delete elements and content.

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

Web Browsers, uses the DOM, for what?

A

Use the DOM specifications to determine how they will display the web pages

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

When we load a web page in the browser, what happens behind the scenes?

A

The browser is taking the HTML document sent from the server, and converting it into the DOM

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

Any language can interact with the DOM?

A

Yes, the DOM is language agnostic.

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

For what purpose we use JS with the DOM?

A

As a way to access and interact with elements on a Web Page

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

In the DOM, everything is made up of what things?

A

NODES

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

What are the “NODES”?

A

Objects that are then made into trees

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

What nodes have, as objects has?

A

properties and methods

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

How many node types exists, that are related to our purpose?

A

6

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

Name the 6 nodes types ir numeric order

A

1 - Element

3 - Text

8 - Comments

9 - Document

10 - DocumentType

11 - DocumentFragments

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

The node type Document What identification number it has, and what is his purpose?

A

number: 9 It is the HTML document itself

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

The node type DocumentType What identification number it has, and what is his purpose?

A

number: 10 Handles the Doctype. e.g. for HTML5 documents.

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

The node type Element What identification number it has, and what is his purpose?

A

number: 1 Element nodes, quite common, represent all of the HTML elements on a page.

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

The node type Text What identification number it has, and what is his purpose?

A

number: 3 text values(valores de texto) often found inside node elements or attributes.

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

Node types and Node elements are the same?

A

NO

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

The node type Comments What identification number it has, and what is his purpose?

A

number: 8 HTML comments

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

The node type DocumentFragments What identification number it has, and what is his purpose?

A

number: 11 Collection of nodes, often used for inserting a group of elements or text nodes together into a document.

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

Attributes elements are nodes in their own right?

A

NO, that was in the past, from DOM 4, attributes will no longer be nodes in the same way.

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

There is any way in the browser to see the DOM represented as a tree like fashion?

A

NO, but it´s quite common to picture it or imagine it like a “tree like” for learning purposes

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

There will be some text nodes that contain white spaces?

A

YES

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

Some text nodes will have whitespace at the beginning or end?

A

Both

24
Q

The DOM, essentially connects web pages to scripts or programming languages?

A

YES

25
Q

What it does? only readable? document.url

A

Returns the document location as a string Retorna la locación del document como una cadena Read only

26
Q

What it does? only readable? document.location

A

returns a Location object, which contains information about the URL of the document, and provides methods for changing that URL and loading another URL Read only

27
Q

What it does?

only readable?

document.characterSet

A

Returns the character set being used by the document

Read only

28
Q

what it does?

read only?

document.title

A

sets or gets the title of the current document

SET AND GET

29
Q

What it does?

Read only?

document.styleSheets

A

returns a list of the style sheet objects on the current document

Read only

30
Q

what it does?

only readable?

document.scripts

A

Returns all the < script > elements on the document

read only

31
Q

what it does?

only readable?

document.head

A

returns the < head > element of the current document

read only

32
Q

what it does?

read only?

document.body

A

returns the < body > element of the current document

only readable, we need to use other methods to change the body as

document.body.textContent

33
Q

what it does?

read only?

document.links

A

returns a list of all the hyperlinks in the document

read only

34
Q

what it does?

only readable?

document.images

A

returns a list of the images in the current document

read only

35
Q

what it does?

read only?

document.forms

A

returns a list of the < form > elements within the current document

read only

36
Q

what it does?

document.getElementById()

A

returns an object reference to the identified element

37
Q

what it does?

document.getElementsByTagName()

A

Returns a list of elements with a given tag name

38
Q

what it does?

document.getElementsByClassName()

A

Returns a list of elements with the given class name

39
Q

what it does?

document.querySelector()

A

Returns the first element node within the document, in document order, that matches the specific selectors

40
Q

what it does?

document.querySelectorAll()

A

returns a list of all the element nodes within the document that match the specified selectors

41
Q

How can we get the current document location as a string?

A

document.url

42
Q

How can we get the object location

A

document.location

43
Q

How can we get the character set being used by the document?

A

document.characterSet

44
Q

How can we get and set the title of a document?

A

document.title

45
Q

How can we get a collection of th style sheets objects on the current document

A

document.styleSheets

46
Q

How can we get all the < scripts > elements on the document

A

document.scripts

47
Q

How can we get the head element of the current document?

A

document.head

48
Q

How can we get the body of the current document?

A

document.body

49
Q

How can we get a collection of all the hyperlinks in the current document

A

document.links

50
Q

How do we get a collection of the images in the current document?

A

document.images

51
Q

How do we get a collection of all the < form > elements in the current document

A

document.forms

52
Q

How do we return an object reference by their ID class

A

document.getElementById()

53
Q

How do we return a list/collection of elements with a given tag name?

A

document.getElementsByTagName()

54
Q

How do we get a collection / list of elements with the given class name

A

document.getElementsByClassName()

55
Q

How do we get the first element node in the document, that matches the specific selectors

A

document.querySelector()

56
Q

How do we get a list / collection of all the element nodes within the document that match the specified selectors?

A

document.querySelectorAll()