Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ArZarLordOfMango authored Jul 28, 2023
1 parent acdf562 commit f7dc926
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function playSound() {
var audioElement = document.getElementById("sound");
audioElement.play();
}
function playSound(button) {
const soundFile = button.dataset.sound;
const audio = new Audio(soundFile);
audio.play();
}

0 comments on commit f7dc926

Please sign in to comment.