How you can use javascript to play the sound for the button color selected

PHOTO EMBED

Wed Dec 15 2021 22:46:34 GMT+0000 (UTC)

Saved by @Samo_Krose #javascript

var audio = new Audio("soundfile.wav");

document.onclick = function() {
  audio.play();
}
content_copyCOPY

https://www.code-helper.com/answers/how-you-can-use-javascript-to-play-the-sound-for-the-button-color-selected