Javascript Clase 9 Flashcards

1
Q

DOM

A

Es una estructura generada por el navegador que representa el html actual.
Las etiquetas son al html, los nodos son a las etiquetas.

Una de las formas de acceder a estas es por: document.body.

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

Estructura DOM

A

ada etiqueta HTML se tranforma en un “nodo elemento”.

La estructura del nodo raiz document se divide en: head y body.

Por lo general las etiquetas nodo crean dos nodos:
Nodo elemento: corresponde a la etiqueta html.
Nodo texto: el texto contenido en la etiqueta.

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

Para acceder elementos del DOM se utilizan los siguiente codigos:

A

-getElementById()
-getElementsByClassName()
-getElementsByTagName()

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

getElementById()

A

Se accede al elemento por la id.

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

getElementsByClassName()

A

Se accede al elemento por la clases en un array con objetos.

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

getElementsByTagName()

A

Se accede al elemento por el tag en un array con objetos.

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

Modificar nodos
InnerText

A

Permite modificar el nodo de texto

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

Modificar nodos
InnerHTML

A

Permite modificar la estructura html junto con el contenido.

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

Modificar nodos
Propiedad classname

A

permite poder modificar el atributo de clase del nodo.

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

Agregar y eliminar nodos
agregar

A

para agregar nodos se utiliza la propiedad document.createElement() y luego a este se le agrega contenido
para terminar con un append() al nodo.

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

Agregar y eliminar nodos
Eliminar

A

para eliminar el nodo referenciado se ocupa la propiedad remove();

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

Agregar y eliminar nodos
Obtener inputs

A

se hace refencia al nodo y se le agrega la propiedad “value=’’”.

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

ES6 se utilizan plantillas

A

Usadas para poder agregar variables al texto sin afectar a la comprensión de este.

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

Query selector

A

Permite seleccionar un nodo con una sintaxis de css como parametro devolviendo un array con el elemento.

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

Query selector All

A

Permite seleccionar varios nodos con una sintaxis de css como parametro devolviendo un array con los elementos.

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