forked from marquez.juan/clase-8-DOM
feat: add changeImage function to update image source and alt text
This commit is contained in:
@@ -68,4 +68,11 @@ const cleanList = (id) => {
|
|||||||
while (list.firstChild) {
|
while (list.firstChild) {
|
||||||
list.removeChild(list.firstChild);
|
list.removeChild(list.firstChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ejercicio 7
|
||||||
|
|
||||||
|
const changeImage = () => {
|
||||||
|
const image = document.querySelector('img');
|
||||||
|
image.src = "foto2.jpg";
|
||||||
|
image.alt = 'Locro';}
|
||||||
Reference in New Issue
Block a user