How to check the status of an HTML5 element? I need to switch play / pause item of video.
There are several methods as shown below.
var myVideo=document.getElementById("video1"); if (myVideo.paused) { myVideo.play(); } else { myVideo.pause(); }
see the full working example here .