Clase 8 Flashcards

1
Q

Agregar nodos a un nodo elemento. JS

A

let agregar = document.getElementById(‘agregar’);

let datosAgregar = document.createElement(‘p’)
datosAgregar.innerHTML = “<strong>Documento creado</strong>”
agregar.append(datosAgregar)

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

Eliminar un nodo elemento del DOM JS

A

let datoEliminar = document.getElementById(‘datoEliminar’)
datoEliminar.remove()

let paises = document.getElementsByClassName(‘paises’)
paises[1].remove()

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

Obtener el valor de input JS

A

let nombre = document.getElementById(‘nombre’)
console.log(nombre.value)

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

Uso de plantillas JS

A

const textoA = “Arpa”
const textoB = “Canción”

$comillasdobles = “Esta es un “+textoA+” y toca una “+textoB
$plantillas = Esta es un ${textoA} y toca una ${textoB}

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

Query Selector JS

A

let datoQuerySelector = document.querySelector(‘.paises’)

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

query Selector All JS

A

let dataQuerySelectorAll = document.querySelectorAll(‘article’)

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