HTML ondurationchange Attribute
Example
//Accessing the element
var vid = document.getElementById("myVideo");
//Creating a function
vid.ondurationchange = function() {
alert("The video duration has changed");
};
Meaning
The durationchange event run when the duration of the audio/video is changed.
Standard Syntax
<element ondurationchange="script">
Applies to:
The ondurationchange attribute can be used on the following element:
| Element | Attribute |
|---|---|
| <video> | ondurationchange |
| <video> | ondurationchange |
Advertisement
Attribute Values
| Value | Description |
|---|---|
| script | Specifies the script to be run on ondurationchange |