-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
21 lines (19 loc) · 707 Bytes
/
script.js
File metadata and controls
21 lines (19 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const audio = document.getElementById("audio");
const playpause = document.getElementById("play");
const volumen = document.querySelector('.volumen')
playpause.addEventListener("click", () =>{
if (audio.paused || audio.ended) {
playpause.querySelector(".pause-btn").classList.toggle("hide");
playpause.querySelector(".play-btn").classList.toggle("hide");
audio.play();
}
else {
audio.pause();
playpause.querySelector(".pause-btn").classList.toggle("hide");
playpause.querySelector(".play-btn").classList.toggle("hide");
}
})
volumen.addEventListener('click', function(){
let vol = this.value
audio.volume = vol
})