Clase 8-Manipulacion del DOM-Bruno TL #1

Open
tocaymasa.bruno wants to merge 13 commits from tocaymasa.bruno/clase-8-DOM:clase8-dom-bruno into main
Showing only changes of commit 898d4ccdbe - Show all commits

View File

@@ -27,4 +27,12 @@ function agregarItem(texto) {
const nuevoElemento = document.createElement("li");
nuevoElemento.textContent = texto;
lista.appendChild(nuevoElemento);
}
}
//ejercicio 4
const parrafos = document.querySelectorAll("#parrafos p");
parrafos.forEach(p => {
if (p.textContent.includes("importante")) {
p.classList.add("destacado");
}
});