zig.com Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>HTML DOM Events</h1>
<h2>The onended Event</h2>
<p>Assign an "onended" event to a video element.</p>
<p>Press play and wait for the video to end.</p>
<video controls onended="myFunction()">
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>
<p>Video courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
<p id="demo"></p>
<script>
  function myFunction() {
    document.getElementById("demo").innerHTML = "The video has ended.";
  }
</script>
</body>
<!-- /jsref/tryit.asp?filename=tryjsref_onended_video Thu, 06 Feb 2025 18:36:48 GMT -->
</html>