feat/excersices #1

Open
saucedo.facundo wants to merge 9 commits from saucedo.facundo/clase-10-ejercicios-de-repaso:feat/excersices into main
3 changed files with 17 additions and 1 deletions
Showing only changes of commit 28718fea20 - Show all commits

View File

@@ -1 +1,7 @@
// Agregar aquí el código javascript
document.getElementById('itemList').addEventListener('click', (event) => {
if (event.target.tagName === 'LI') {
event.target.classList.toggle('selected');
}
});

View File

@@ -1,2 +1,5 @@
/* Agregar el código CSS necesario para el ejercicio */
.selected {
background-color: lightblue;
}

View File

@@ -8,7 +8,14 @@
</head>
<body>
<h1>Ejercicio 3</h1>
<ul id="itemList">
<li>Elemento 1</li>
<li>Elemento 2</li>
<li>Elemento 3</li>
<li>Elemento 4</li>
<li>Elemento 5</li>
<li>Elemento 6</li>
</ul>
<script src="ejercicio3.js"></script>
</body>
</html>