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">
Browser Support
Status
Applies to:
The ondurationchange attribute can be used on the following element:
Element | Attribute |
---|---|
<video> | ondurationchange |
<video> | ondurationchange |
Attribute Values
Value | Description |
---|---|
script | Specifies the script to be run on ondurationchange |