Returns : *
The tween or timeline associated with the given ID. Returns undefined
if no tween or timeline has that ID.
Details
When creating a tween or timeline you can assign it an ID to use. Then later you can refer to it using that ID. This is particularly helpful when using frameworks and build tools like React where keeping track of variables can be difficult.
gsap.to(obj, {id: "myTween", duration: 1, x: 100});
//later
gsap.getById("myTween"); //returns the tween