main #15
@@ -5,3 +5,11 @@ const changeText = (str) => {
|
||||
const h1 = document.querySelector("h1");
|
||||
h1.textContent = str;
|
||||
}
|
||||
|
||||
// Ejercicio 2
|
||||
const addClass = (className) => {
|
||||
const itemLista = document.querySelectorAll("li");
|
||||
itemLista.forEach((item) => {
|
||||
item.classList.add(className);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,6 +101,14 @@ h1 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Clase item-lista */
|
||||
.item-lista {
|
||||
background: #fff4d6;
|
||||
border-color: #f4b400;
|
||||
color: #7a5200;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* =========================
|
||||
IMAGEN
|
||||
========================= */
|
||||
|
||||
Reference in New Issue
Block a user