forked from marquez.juan/clase-8-DOM
ejercicio 4
This commit is contained in:
@@ -17,4 +17,10 @@ const lista = document.querySelector("#lista-inicial");
|
|||||||
const nuevoitem = document.createElement("li")
|
const nuevoitem = document.createElement("li")
|
||||||
nuevoitem.textContent = comida;
|
nuevoitem.textContent = comida;
|
||||||
lista.appendChild(nuevoitem);
|
lista.appendChild(nuevoitem);
|
||||||
|
}
|
||||||
|
//ejercicio 4
|
||||||
|
const parrafos = document.querySelectorAll("#parrafos p");
|
||||||
|
for (const parrafo of parrafos){
|
||||||
|
if (parrafo.textContent.includes ("importante"))
|
||||||
|
parrafo.classList.add("destacado")
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user