Forum Discussion

JoshuaThian's avatar
JoshuaThian
Community Member
2 months ago

Change a text color using javascript GSAP

Hi, I'm looking to change a text color using javascript GSAP. I tried the following code: let gemba = document.querySelector("[data-acc-text='Gemba']"); gsap.to(gemba, {duration:2, fill:'#8d3...
  • Nedim's avatar
    2 months ago

    Try this:

    let gemba = document.querySelector("[data-acc-text='Gemba'] text");
    gsap.to(gemba, {duration:2, fill:'#8d3dae'});