Open In App

SVG Document.timeline property

Last Updated : 13 Jun, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The SVG Document.timeline property represents the default timeline of the current document. This timeline is automatically created when the page loads. For each document timeline is unique.

Syntax:

var tl = document.timeline

Return value: This property returns an object which contains information about the timeline of the document.

Example 1: 

HTML




<!DOCTYPE html>
<html>
 
<body>
    <svg width="700" height="500"
        xmlns="http://www.w3.org/2000/svg">
 
        <script>
            console.log(document.timeline);
        </script>
    </svg>
</body>
 
</html>


Output:

Example 2:

HTML




<!DOCTYPE html>
<html>
 
<body>
    <h1>GeeksforGeeks</h1>
    <div id="abc"></div>
     
    <svg width="700" height="500"
        xmlns="http://www.w3.org/2000/svg">
 
        <script>
            var a = document.getElementById("abc");
            a.innerHTML = "Timeline of document is "
                + document.timeline.currentTime;
        </script>
    </svg>
</body>
 
</html>


Output:

Supported Browsers:

  • Google Chrome 84+
  • Edge 84+
  • Firefox 75+
  • Safari 13.1+
  • Opera 70+
  • Internet Explorer not supported


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads