0
How to make a toggle play/pause audio in only one button using the .pause and .paused trick?
I don't know how these .pause and .paused work at all, I don't what is the play and what is the pause on the two of them. So I wanna see a toggle play/pause in only one button to see how they really work.
3 Answers
+ 1
Here is what you want
https://code.sololearn.com/WjEyPIGh0Zh5/?ref=app
0
Kashyap Kumar ā
Thank you bro! But last question, what does the .classList.toggle("paused") do? I removed the class="" and that and it still worked??
0
That line remove the class if already exists and add if doesn't exist. Generally used for styling.