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 0681eea commit b653beb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ function tocaSom(idElementoAudio){
document.querySelector(idElementoAudio).play();
}

tecla.onkeydown = function () {
tecla.classList.add('tiva');
}

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

0 comments on commit b653beb

Please sign in to comment.