Open In App
Related Articles

HTML DOM Audio textTracks Property

Improve Article
Save Article
Like Article

HTML DOM Audio textTracks Property is used for returning a TextTrackList object. The TextTrackList object represents the available text tracks for the audio. Every available text track is represented by a TextTrack Object. 



Return Value: It returns a TextTrackList Object Which represents the available text tracks for the audio. TextioTrackList Object is:

  • length: It is used to get the number of text tracks available in the audio
  • [index]: It is used to get TextTrack object by index

Examples: In this example, we will see the use of  DOM Audio textTracks Property.


<!DOCTYPE html>
          HTML DOM Audio textTracks Property
        h1 {
            color: green;
        h2 {
            font-family: Impact;
        body {
            text-align: center;
    <h2>HTML DOM Audio textTracks Property</h2>
    <audio id="track" controls>
        <source src="bells.ogg" type="audio/ogg">
        <source src="bells.mp3" type="audio/mpeg">
        <track src="demo_sub.vtt">
        Your browser does not support the audio element.
        Double-click the "Access Audio" button
        to get the duration of the audio, in seconds.
    <button onclick="access()">Access Audio</button>
    <p id="test"></p>
        function access() {
            // Accessing audio element duration.
            let m = document.getElementById(
            document.getElementById("test").innerHTML = m;



Supported Browsers: The browser supported by DOM Audio textTracks Property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 16 Jun, 2023
Like Article
Save Article
Similar Reads
Complete Tutorials