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?

24
Q

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

25
What it does? only readable? document.url
Returns the document location as a string Retorna la locación del document como una cadena Read only
26
What it does? only readable? document.location
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
What it does? only readable? document.characterSet
Returns the character set being used by the document Read only
28
what it does? read only? document.title
sets or gets the title of the current document SET AND GET
29
What it does? Read only? document.styleSheets
returns a list of the style sheet objects on the current document Read only
30
what it does? only readable? document.scripts
Returns all the \< script \> elements on the document read only
31
what it does? only readable? document.head
returns the \< head \> element of the current document read only
32
what it does? read only? document.body
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
what it does? read only? document.links
returns a list of all the hyperlinks in the document read only
34
what it does? only readable? document.images
returns a list of the images in the current document read only
35
what it does? read only? document.forms
returns a list of the \< form \> elements within the current document read only
36
what it does? document.getElementById()
returns an object reference to the identified element
37
what it does? document.getElementsByTagName()
Returns a list of elements with a given tag name
38
what it does? document.getElementsByClassName()
Returns a list of elements with the given class name
39
what it does? document.querySelector()
Returns the **first element** node within the document, **in document order**, that matches the specific selectors
40
what it does? document.querySelectorAll()
returns a list of all the element nodes within the document that match the specified selectors
41
How can we get the current document location as a string?
document.url
42
How can we get the object location
document.location
43
How can we get the character set being used by the document?
document.characterSet
44
How can we get and set the title of a document?
document.title
45
How can we get a collection of th style sheets objects on the current document
document.styleSheets
46
How can we get all the \< scripts \> elements on the document
document.scripts
47
How can we get the head element of the current document?
document.head
48
How can we get the body of the current document?
document.body
49
How can we get a collection of all the hyperlinks in the current document
document.links
50
How do we get a collection of the images in the current document?
document.images
51
How do we get a collection of all the \< form \> elements in the current document
document.forms
52
How do we return an object reference by their ID class
document.getElementById()
53
How do we return a list/collection of elements with a given tag name?
document.getElementsByTagName()
54
How do we get a collection / list of elements with the given class name
document.getElementsByClassName()
55
How do we get the first element node in the document, that matches the specific selectors
document.querySelector()
56
How do we get a list / collection of all the element nodes within the document that match the specified selectors?
document.querySelectorAll()