I used the below code in my JS file for a sliding puzzle game, but it does not work. What am I doing wrong?
var backgroundSound= new Audio("tetris.mp3");
backgroundSound.addEventListener('ended', function() {
this.currentTime = 0;
this.play();
}, false);
backgroundSound.play();