HTML DOM Track default Property
Example
Get the default state of the track:
var x = document.getElementById("myTrack").default;
x output will be:
false
Definition and Usage
The default property sets or returns the default state of the track.
This property reflects the <track> default attribute.
If the default attribute is used, it specifies that the track is to be enabled if no other track is more suitable for the user (e.g. based on user preferences).
Note: There can only be one <track> element with the default attribute per media element.
Browser Support
The default property is supported in Internet Explorer, Opera, and Chrome.
Note: The default property is not supported in Firefox, Safari, or Internet Explorer 9 and earlier.
Syntax
Return the default property:
trackObject.default
Set the default property:
trackObject.default=true|false
Property Values
| Value | Description |
|---|---|
| true|false | Specifies the default state of the track.
|
Technical Details
| Return Value: | A Boolean, representing the default state of the track. |
|---|
More Examples
Example
Set the default state of the track:
document.getElementById("myTrack").default=true;
Related Pages
HTML Reference: HTML <track> default Attribute
YouTip