files/en-us/web/api/animation/timeline/index.md
{{ APIRef("Web Animations") }}
The Animation.timeline property of the {{domxref("Animation")}} interface returns or sets the {{domxref("AnimationTimeline", "timeline")}} associated with this animation. A timeline is a source of time values for synchronization purposes, and is an {{domxref("AnimationTimeline")}}-based object. By default, the animation's timeline and the {{domxref("Document")}}'s timeline are the same.
A {{domxref("AnimationTimeline", "timeline object", "", 1)}} to use as the timing source for the animation, or null to use the default, which is the {{domxref("Document")}}'s timeline.
Here we set the animation's timeline to be the same as the document's timeline (this is the default timeline for all animations, by the way):
animation.timeline = document.timeline;
{{Specifications}}
{{Compat}}