Horje

How to use HTML onsuspend Attribute

This attribute contains single value script which works when onsuspend event attribute call.
index.html
Example: HTML
<!DOCTYPE html> 
<html> 
 
<head> 
    <title> 
        HTML onsuspend Attribute 
    </title> 
</head> 
 
<body> 
    <center> 
        <h1 style="color:green">Horje</h1> 
        <h2>HTML onsuspend Attribute</h2> 
 
      
        <audio controls id-"audioID"> 
            <source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_700KB.mp3" type="audio/mpeg"> 
        </audio> 
    </center> 
    <script> 
        document.getElementById( 
            "audioID").addEventListener("suspend", GFGfun); 
 
        function GFGfun() { 
            alert( 
                "Media loading suspended"); 
        } 
    </script> 
 
</body> 
 
</html> 

Output should be:

How to use HTML onsuspend Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin