Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Track default property

Track default property

Track Object Reference The Track object

Example

Get the default state of the track:

var x = document.getElementById("myTrack").default;

x The output result is:

false


Definition and Usage

The default property is used to set or return the default state of the track.

This property reflects The default property.

If the default property is used, it specifies that this track should be used, in case the user has not selected another track.

**Note:** There cannot be more than one track element. Each media element's track element can have only one default property. T


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer, Opera, and Chrome browsers support the srclang property.

**Note:** Firefox, Safari, or Internet Explorer 9 and earlier IE versions do not support the srclang property.


Syntax

Return the default property:

trackObject

.default

Set the default property:

trackObject

.default=true|false

Attribute values

Value Description
true|false Tracks the default state of this track
  • true - the track is enabled
  • false - default. the track is disabled
  • |

    Technical Details

    Return Value: 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 Manual: HTML The default property


    Track Object Reference The Track object