Skip to content
Related Articles

Related Articles

Improve Article

SVG Document.timeline property

  • Last Updated : 16 Nov, 2020

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
  • Edge
  • Firefox
  • Safari
  • Opera
  • Internet Explorer

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :