Compare commits
3 Commits
main
...
ad2f54d04c
| Author | SHA1 | Date | |
|---|---|---|---|
| ad2f54d04c | |||
| 799a081fbe | |||
| f91489c01d |
20
ejercicios.js
Normal file
20
ejercicios.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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);
|
||||
}
|
||||
@@ -31,5 +31,6 @@
|
||||
<p>¿Y este párrafo? ¿Será importante?</p>
|
||||
<p>Este es otro párrafo del montón.</p>
|
||||
</div>
|
||||
<script src="ejercicios.js" ></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user