Open In App

HTML DOM onloadeddata Event

The DOM onloadeddata event in HTML occurs when the current frame data is loaded but the next frame’s data is not enough data to play the audio/video. Events that occur during the loading process of an audio/video: 

Supported HTML tags: 



Syntax: 

<element onloadeddata="myScript">
object.onloadeddata = function(){myScript};
object.addEventListener("loadeddata", myScript);

Example: In JavaScript, using the addEventListener() method 






<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM onloadeddata Event
    </title>
</head>
 
<body>
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
    <h2>
        HTML DOM onloadeddata Event
    </h2>
    <video controls id="VideoId">
        <source src=
                type="video/mp4">
    </video>
   
    <script>
        document.getElementById(
            "VideoId").addEventListener(
                "loadeddata", GFGFun);
 
        function GFGFun() {
            alert("Browser has loaded the current frame");
        }
    </script>
</body>
 
</html>

Output: 

 

Supported Browsers: The browsers supported by HTML DOM onloadeddata Event are listed below: 


Article Tags :