SVG Document.timeline property
Last Updated :
13 Jun, 2022
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"
< 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"
< 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
Share your thoughts in the comments
Please Login to comment...