Capítulo 123 de 411

Chapter 123: Tween.targets()

Core Idea

targets() returns the array of objects this tween animates; if selector text was used, this array holds the matched DOM elements.

Code Examples

gsap.to(".box", { x: 100 }).targets(); // NodeList-derived array of .box elements

Key Takeaways

  1. Useful for recovering the actual resolved elements from a tween created with selector text, e.g. to run further non-GSAP logic on them.