Open In App

SVG Document.timeline property

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: 






<!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:




<!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:


Article Tags :