Advertisement
Home Open Editor ❯

HTML Audio/Video DOM loadeddata Event

Example

//Accessing the element
var vid = document.getElementById("myVideo");

//Creating a function
vid.onloadeddata = function() {
  alert("Browser has been loaded");
};

Try this code ❯

Meaning

The loadeddata event run when the browser has loaded the current frame of the audio/video.


Standard Syntax

HTML:

<element onloadeddata="myScript">

JavaScript:

object.onloadeddata=function(){myScript};

JavaScript, using the addEventListener() method::

object.addEventListener("loadeddata", myScript);


Advertisement

Technical Details

Type Description
Supported HTML tags: <audio> and <video>
Supported JavaScript objects: Audio, Video
Home Open Editor ❯
Advertisement