Can I iterate thru a Node List of audio elements to change any that are paused to currentTime = 0

25 Views Asked by At

I'm trying to make a table of 180 tunes, each tune has an audio element. Once I play the tune and hit the play button again to pause it I want the currentTime to go back to zero.

This isn't working:

        const myAudio = document.getElementsByClassName ("myAudio");
        for (let i=0; i<myAudio.length; i++)
        myAudio[i].addEventListener("pause", (event) => {
            myAudio.currentTime = 0;
        } 
0

There are 0 best solutions below