<video id="videoPlayer" controls> <source src="sample-video.mp4" type="video/mp4"> </video> <script> var videoPlayer = document.getElementById("videoPlayer"); videoPlayer.ontimeupdate = function() { if (Math.floor(videoPlayer.currentTime) === 10) { alert("10 seconds have passed!"); } }; </script>