forked from marquez.juan/clase-8-DOM
feat: add addClass function and style for item-lista
This commit is contained in:
@@ -6,3 +6,12 @@ const changeTittle = (a) => {
|
|||||||
const tittle = document.querySelector('h1');
|
const tittle = document.querySelector('h1');
|
||||||
tittle.textContent = a;
|
tittle.textContent = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ejercicio 2
|
||||||
|
|
||||||
|
const addClass = (a) => {
|
||||||
|
const list = document.querySelectorAll('li');
|
||||||
|
list.forEach((item) => {
|
||||||
|
item.classList.add(a);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -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