feat/excersices #6
@@ -23,4 +23,15 @@ const addItem = (a) => {
|
||||
const newItem = document.createElement('li');
|
||||
newItem.textContent = a;
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user