html tutorial - onprogress Attribute in HTML - html5 - html code - html form

Onprogress attribute in html

Learn html - html tutorial - Onprogress attribute in html - html examples - html programs

  • The onprogress attribute defines a script to be run when the browser is downloading the specified audio/video.
  • During the loading process of an audio/video, the following events occur in this order: onloadstart, ondurationchange, onloadedmetadata, onloaded data, onprogress, oncanplay, oncanplaythrough.
  • The onprogress attribute is part of the Event Attributes.

Syntax for onprogress attribute in HTML:

<element onprogress=”script”>

Applies To:

Element Attribute
<audio> onprogress
<video> onprogress

Attribute Values:

Value Description
script The script can run on onprogress

Sample Coding for onprogress Attribute in HTML:

Tryit<!DOCTYPE html>
         <title>Wikitechy onprogress attribute</title>
       <audio id="myAudio" controls onprogress="onProgress()">
       <source src=" welcome.wav" type="audio/wav">
       <source src="welcome.mp3" type="audio/mp3">
       function onProgress()
        alert("The Wikitechy audio has started downloading");

Code Explanation for onprogress Attribute in HTML:

onprogress Attribute Code Explanation

  1. The <audio> tag is used to embed the audio in HTML.
  2. The onprogress attribute is used to run “onProgress()” when the audio file is being downloaded.
  3. The function onProgress() function is used to activate the alert box with message when the onprogress event is activated.

Output for onprogress Attribute in HTML:

onprogress Attribute Tag Output

  1. The alert box will appear when the audio file being progress.

Browser Support for onprogress Attribute in HTML:

Yes 9.0 Yes Yes Yes

Related Searches to onprogress Attribute in html