Related Articles

Related Articles

HTML onsuspend Attribute
  • Last Updated : 07 Aug, 2020

The HTML onsuspend is a event attribute which occurs when the browser not getting media data. This event occurs when the media loading is suspended. This can happen when the download has completed, or it has been paused because of some interruption. 

Usage: It is used in <audio> and <video> Tags,

Syntax: 

<element onsuspend="Script">

Attribute Value: This attribute contains single value script which works when onsuspend event attribute call

Example:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
  
<head
    <title
        HTML onsuspend Attribute 
    </title
</head
  
<body
    <center
        <h1 style="color:green">GeeksforGeeks</h1
        <h2>HTML onsuspend Attribute</h2
  
       
        <audio controls id-"audioID"> 
            <source src="beep.mp3" type="audio/mpeg"
        </audio
    </center
    <script
        document.getElementById( 
            "audioID").addEventListener("suspend", GFGfun); 
  
        function GFGfun() { 
            alert( 
                "Media loading suspended"); 
        
    </script
  
</body
  
</html

chevron_right


Output:

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :