Open In App

HTML onloadstart Attribute

The HTML onloadstart Attribute is an event attribute that occurs when the loading process of a specified audio/video starts. 

Syntax: 



<element onloadstart="myScript">

 Attribute Value: This attribute contains a single value script that works when onloadstart event attribute call. This attribute is supported by <audio> and <video> tags.

Example: 




<!DOCTYPE html> 
<html
  
<head
    <title
        HTML  onloadstart Attribute 
    </title
</head
  
<body
    <center
        <h1 style="color:green"
        GeeksforGeeks 
    </h1
        <h2>DOM onloadstart Attribute</h2
        <audio controls id="audId"
        <source src
        type="audio/mpeg">
        </audio
  
        <script
            document.getElementById( 
            "audId").addEventListener( 
            "loadstart", GFGFun); 
  
            function GFGFun() { 
                alert("Start the load audio"); 
            
        </script
    </center
</body
  
</html>                    

Output: 



After: 


Article Tags :