so I have set up a basic audio player with a progress bar.
So far I have a play button that makes the bar start and move, but I want to stop that progress when "Pause" is clicked, and resume when "Play" is pressed again. What would be the function for this?
My JS knowledge is pretty basic so I found this on W3schools
function move() {
    var elem = document.getElementById("myBar");   
    var width = 1;
    var id = setInterval(frame, 100);
    function frame() {
    if (width >= 100) {
        clearInterval(id);
    } else {
        width++; 
        elem.style.width = width + '%'; 
    }
    }
}#myProgress {
    width: 100%;
    background-color: #ddd;
}
#myBar {
    width: 1%;
    height: 30px;
    background-color: #4CAF50;
}<h1>JavaScript Progress Bar</h1>
<div id="myProgress">
    <div id="myBar"></div>
</div>
<br>
<button onclick="move()">Play</button> 
<button>Pause</button>  
     
     
    