javascript play pause button code example
Example: javascript play pause button
var button = document.getElementById("button");
var audio = document.getElementById("player");
button.addEventListener("click", function(){
if(audio.paused){
audio.play();
button.innerHTML = "Pause";
} else {
audio.pause();
button.innerHTML = "Play";
}
});