Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielCastro26 authored Oct 26, 2023
1 parent 939e694 commit 9fd9523
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ document.querySelector(idElementoAudio).play();
}

const listaDeTeclas = document.querySelectorAll('.tecla');
let contador=0;
while(contador <listaDeTeclas.length) {

for(let contador=0; contador <listaDeTeclas.length; contador++) {
const tecla= listaDeTeclas[contador];
const instrumento = tecla.classList[1];
const idAudio =`#som_${instrumento}`;
tecla.onclick =function () {
tocaSom(idAudio);
};
contador = contador + 1;
console.log(contador);
console.log(instrumento);
console.log(idAudio);
}

0 comments on commit 9fd9523

Please sign in to comment.