I'm creating a SplitText reference using a dropdown to choose properties and a button to start the animation with the chosen properties. With the properties hard coded everything works, but I can't figure out how to dynamically add them. I've tried using back ticks (`${property}` and just the variable name. I logged property and it's correctly grabbing values (chars, words and lines)
const property = document.querySelector('select').value
const tl = new TimelineLite
mySplitText = new SplitText(".splittext", {type: "words, lines, chars"})
chars = mySplitText.chars
lines = mySplitText.lines
words = mySplitText.words
tl.staggerFrom(property, 1, {opacity:0, y:80, ease: Elastic.easeOut}, 0.4)
document.getElementById("animate").onclick = function() {
tl.restart();
}