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



Onloadeddata attribute in html

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

  • The onloadeddata attribute triggers when data for the current frame is loaded, but not enough data to play next frame of the specified media such as audio/video.
  • This event triggered during the loading process.

Syntax for onloadeddata attribute in HTML:

<audio onloadeddata="script">

Applies To:

Elements Attribute
<audio> onloadeddata
<video> onloadeddata

Attribute Values:

Value Description
script The script can run on onloadeddata.

Sample Coding for onloadeddata Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
        <head>
        <title>Wikitechy onloadeddata attribute</title>
        </head>
 <body>
        <audio controls onloadeddata="loadedData()">
        <source src="wikitechy.wav" type="audio/wav">
        <source src="wikitechy.mp3" type="audio/mp3">
        </audio>
        <script>
        function loadedData()
          {
             alert("The Wikitechy Audio is loaded!");
          }
        </script>
</body>
</html>

Code Explanation for onloadeddata Attribute in HTML:

onloadeddata Attribute Code Explanation

  1. onloadeddata attribute used to trigger an event when current data frame of audio is loaded.
  2. loadedData JavaScript function show an alert message “The Wikitechy Audio is loaded!”.

Output for onloadeddata Attribute in HTML:

onloadeddata Attribute Tag Output

  1. The output shows "The Wikitechy Audio is loaded!” in an alert message.

Browser Support for onloadeddata Attribute in HTML:

Yes 9.0 Yes Yes Yes

Related Searches to onloadeddata Attribute in html