diff --git a/ejercicios.js b/ejercicios.js index f4b8f77..d227970 100644 --- a/ejercicios.js +++ b/ejercicios.js @@ -17,4 +17,10 @@ const lista = document.querySelector("#lista-inicial"); const nuevoitem = document.createElement("li") nuevoitem.textContent = comida; 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") } \ No newline at end of file