Agrego ejercicio 4 de la clase 8
This commit is contained in:
@@ -29,3 +29,17 @@ function agregarItem(comidas) {
|
|||||||
nuevoItem.textContent = comidas;
|
nuevoItem.textContent = comidas;
|
||||||
lista.appendChild(nuevoItem);
|
lista.appendChild(nuevoItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Ejercicio 4 de la clase 8.
|
||||||
|
|
||||||
|
function destacarParrafos() {
|
||||||
|
const selecparrafos = document.querySelectorAll("#parrafos p");
|
||||||
|
|
||||||
|
for (const parrafo of selecparrafos) {
|
||||||
|
if (parrafo.textContent.includes("importante")) {
|
||||||
|
parrafo.classList.add("destacado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user