forked from marquez.juan/clase-8-DOM
Compare commits
4 Commits
main
...
navegador-
| Author | SHA1 | Date | |
|---|---|---|---|
| cad713b5c0 | |||
| 27145b04b1 | |||
| e59c8a8a16 | |||
| 9c81164673 |
15
.vscode/launch.json
vendored
Normal file
15
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Chrome against localhost",
|
||||||
|
"url": "http://localhost:8080",
|
||||||
|
"webRoot": "${workspaceFolder}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1 +1,78 @@
|
|||||||
// Vincular este archivo al archivo index.html, y resolver aquí los ejercicios.
|
// Vincular este archivo al archivo index.html, y resolver aquí los ejercicios.
|
||||||
|
//1
|
||||||
|
/*
|
||||||
|
const tituloh1 = document.querySelector("h1")
|
||||||
|
console.log(tituloh1.textContent);
|
||||||
|
tituloh1.textContent = "Titulo reemplazado correctamente"
|
||||||
|
*/
|
||||||
|
//2
|
||||||
|
/*
|
||||||
|
function List(){
|
||||||
|
const items = document.querySelectorAll("ul li")
|
||||||
|
for (const item of items){
|
||||||
|
item.classList.add("item-lista")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//3
|
||||||
|
/*
|
||||||
|
function agregarItem(texto){
|
||||||
|
const nuevoLi = document.createElement("li");
|
||||||
|
nuevoLi.textContent = texto;
|
||||||
|
const lista = document.getElementById("lista-inicial");
|
||||||
|
lista.appendChild(nuevoLi);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//4
|
||||||
|
/*
|
||||||
|
function div(){
|
||||||
|
const lista_de_parrafos = document.querySelectorAll("#parrafos p");
|
||||||
|
for (const un_parrafo of lista_de_parrafos) {
|
||||||
|
if (un_parrafo.textContent.indexOf("importante") > -1){
|
||||||
|
un_parrafo.classList.add("destacado");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//5
|
||||||
|
/*
|
||||||
|
function nuevoDiv(){
|
||||||
|
const contenedor = document.createElement('div')
|
||||||
|
const titulo = document.createElement('h2')
|
||||||
|
titulo.textContent = 'Sabores de la region del litoral';
|
||||||
|
const parrafo = document.createElement('p');
|
||||||
|
parrafo.textContent = 'Lista de sabores';
|
||||||
|
const lista = document.createElement('li')
|
||||||
|
const comidas = [
|
||||||
|
'Chipa',
|
||||||
|
'Pescado de rio a la parrilla',
|
||||||
|
'Chupin',
|
||||||
|
'Sopa paraguaya'
|
||||||
|
];
|
||||||
|
comidas.forEach(comida => {
|
||||||
|
const item = document.createElement('li');
|
||||||
|
item.textContent = comida;
|
||||||
|
lista.appendChild(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//6
|
||||||
|
/*
|
||||||
|
function limpiarLista(listaInicial){
|
||||||
|
const lista = document.getElementById(listaInicial);
|
||||||
|
if (lista) {
|
||||||
|
lista.innerHTML = ""
|
||||||
|
} else {
|
||||||
|
console.warn(`No se encontró ninguna lista con el id: "${listaInicial}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//7
|
||||||
|
function modificar(img){
|
||||||
|
const imagen = document.querySelector(img)
|
||||||
|
console.log(imagen.getAttribute("src"))
|
||||||
|
imagen.setAttribute("src", "foto2.jpg");
|
||||||
|
imagen.setAttribute("alt", "locro");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -100,6 +100,9 @@ h1 {
|
|||||||
color: #7a5200;
|
color: #7a5200;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.item-lista{
|
||||||
|
color:#d7263d;
|
||||||
|
}
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
IMAGEN
|
IMAGEN
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
tiene sus propias comidas típicas, hay algunas que son
|
tiene sus propias comidas típicas, hay algunas que son
|
||||||
tradicionales en casi todas las provincias:</p>
|
tradicionales en casi todas las provincias:</p>
|
||||||
|
|
||||||
<ul class="lista-comidas" id="lista-inicial">
|
<ul class="lista-comidas" id="listaInicial">
|
||||||
<li>Asado</li>
|
<li>Asado</li>
|
||||||
<li>Empanadas</li>
|
<li>Empanadas</li>
|
||||||
<li>Locro</li>
|
<li>Locro</li>
|
||||||
@@ -32,4 +32,5 @@
|
|||||||
<p>Este es otro párrafo del montón.</p>
|
<p>Este es otro párrafo del montón.</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
<script src="ejercicios-clase-8.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user