My code plays an audio when the button is clicked but It does not pause when I click it again.
I want to use the same button to play and pause the audio using js.
const rollSound = new Audio
("sounds/short-guided-meditation.ogg");
document.getElementById('play').addEventListener("click", e => rollSound.play());
any help would be highly appreciated.
Edit: I still need an answer. Please share your knowledge.