26 lines
782 B
JavaScript
26 lines
782 B
JavaScript
// Vincular este archivo al archivo index.html, y resolver aquí los ejercicios.
|
|
//ejercicio 1
|
|
function titulo(){
|
|
document.querySelector("h1").textContent = "Gastronomia Argentina";
|
|
}
|
|
//ejercicio 2
|
|
function ejercicio2() {
|
|
const items = document.querySelectorAll("li");
|
|
for (const item of items) {
|
|
item.classList.add("item-lista");
|
|
item.style.color = "red"
|
|
}
|
|
}
|
|
//ejercicio 3
|
|
function agregaritem(comida){
|
|
const lista = document.querySelector("#lista-inicial");
|
|
const nuevoitem = document.createElement("li")
|
|
nuevoitem.textContent = comida;
|
|
lista.appendChild(nuevoitem);
|
|
}
|
|
//ejercicio 4
|
|
const parrafos = document.querySelectorAll("#parrafos p");
|
|
for (const parrafo of parrafos){
|
|
if (parrafo.textContent.includes ("importante"))
|
|
parrafo.classList.add("destacado")
|
|
} |