Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

HTML onloadeddata Attribute


Definition and Usage

The loadeddata event occurs when data for the current frame is loaded, but not enough data to play next frame of the specified audio/video.

During the loading process of an audio/video, the following events occur, in this order:

  1. onloadstart
  2. ondurationchange
  3. onloadedmetadata
  4. loadeddata
  5. onprogress
  6. oncanplay
  7. oncanplaythrough

Applies to

The onloadeddata attribute is part of the Event Attributes, and can be used on the following elements:

Elements Event
<audio> loadeddata
<video> loadeddata

Examples

Audio Example

Run "myFunction" when the loadeddata event occurs:

<audio onloadeddata="myFunction()">
Try it Yourself »

Video Example

Run "myFunction" when the loadeddata event occurs:

<video onloadeddata="myFunction()">
Try it Yourself »

Browser Support

The onloadeddata attribute has the following browser support for each element:

Element
audio Yes 9.0 Yes Yes Yes
video Yes 9.0 Yes Yes Yes