Cree una funcion para agregar una clase personalizada
This commit is contained in:
@@ -5,3 +5,11 @@ const changeText = (str) => {
|
|||||||
const h1 = document.querySelector("h1");
|
const h1 = document.querySelector("h1");
|
||||||
h1.textContent = str;
|
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;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clase item-lista */
|
||||||
|
.item-lista {
|
||||||
|
background: #fff4d6;
|
||||||
|
border-color: #f4b400;
|
||||||
|
color: #7a5200;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
IMAGEN
|
IMAGEN
|
||||||
========================= */
|
========================= */
|
||||||
|
|||||||
Reference in New Issue
Block a user