YouTip LogoYouTip

Prop Track Default

# HTML DOM Track default Property [![Image 8: Track Object Reference](#) Track Object](#) ## Example Get the default state of the track: ```javascript var x = document.getElementById("myTrack").default; The output of _x_ 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` attribute. If the `default` attribute is used, it specifies that the track should be enabled if the user has not selected another track. **Note:** There can only be one track element with the `default` attribute per media element. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) Internet Explorer, Opera, and Chrome 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: ```javascript trackObject.default Set the `default` property: ```javascript trackObject.default=true|false ## Property Values | Value | Description | | --- | --- | | true|false | Sets or returns the default state of the track. * true - The track is enabled. * false - Default. The track is disabled. | ## Technical Details | Return Value: | A Boolean, representing the default state of the track | | --- | * * * ## More Examples ## Example Set the default state of the track: ```javascript document.getElementById("myTrack").default=true; * * * ## Related Pages HTML Reference: [HTML `` default attribute](#) * * Track Object](#)
← Prop Track KindDom Obj Track β†’