feat: add highlight function to emphasize important paragraphs

This commit is contained in:
2026-05-14 14:22:19 -03:00
parent 215bc5e6d2
commit abe82db60b

View File

@@ -24,3 +24,14 @@ const addItem = (a) => {
newItem.textContent = a; newItem.textContent = a;
list.appendChild(newItem); list.appendChild(newItem);
} }
// Ejercicio 4
const highlight = () => {
const paragraphs = document.querySelectorAll('#parrafos p');
paragraphs.forEach((p) => {
if (p.textContent.toLowerCase().includes('importante')) {
p.classList.add('destacado');
}
});
}