Open In App

HTML DOM onloadstart Event

The HTML DOM onloadstart event occurs when the loading process of a specified audio/video starts. events that occur during the loading process of an audio/video:

Syntax:



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

Example: In this example, we will see the use of DOM onloadstart Event.




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML DOM loadstar event
    </title>
</head>
 
<body>
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
    <h2>DOM loadstar event</h2>
    <video controls id="VidId">
        <source src=
                type="video/mp4">
    </video>
 
    <script>
        document.getElementById(
            "VidId").addEventListener(
                "loadstart", GFGFun);
        function GFGFun() {
            alert("Start the load video");
        }
    </script>
</body>
 
</html>

Output:



Supported Browsers: The browsers supported by HTML DOM onloadstart event are listed below:

Article Tags :