diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 8c764f5..60cfdfd 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -28,4 +28,18 @@ function agregarItem(comidas) { const nuevoItem = document.createElement("li"); nuevoItem.textContent = comidas; 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"); + } + } } \ No newline at end of file