HTML onprogress Attribute

The HTML onprogress Attribute is a event attribute which occurs when the browser is downloading the specified audio or video.

Syntax:

<element onprogress="myScript">

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

Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML onprogress Attribute
        </title>
    </head>
  
    <body>
        <center>
            <h1 style="color: green;">
                GeeksforGeks
            </h1>
            <h2>
                HTML onprogress Attribute
            </h2>
  
            <audio controls id="audioID" 
                   onprogress="GFGfun()">
                <source src=
                        type="audio/mpeg" />
            </audio>
  
            <script>
                function GFGfun() {
                    alert("audio progress");
                }
            </script>
        </center>
    </body>
</html>

chevron_right


Output:



After downloding the the media:

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML onprogress Attribute
        </title>
    </head>
  
    <body>
        <center>
            <h1 style="color: green;">
                GeeksforGeks
            </h1>
            <h2>
                HTML onprogress Attribute
            </h2>
  
            <video controls id="vidID" 
                   onprogress="GFGfun()" 
                   width="320"
                   height="240">
                <source src=
                        type="video/mp4" />
            </video>
  
            <script>
                function GFGfun() {
                    alert("Video progress");
                }
            </script>
        </center>
    </body>
</html>

chevron_right


Output:

After:

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.