How to play and pause a video by on click

document.getElementById("play").onclick = function(){
    if (document.getElementById("videoPlay").paused){
        document.getElementById("videoPlay").play();
    } else {
        document.getElementById("videoPlay").pause(); 
    }
}

Leave a comment

Your email address will not be published. Required fields are marked *