Errors of 'undefined' when manipulating static elements in the webflow DOM

HI guys,

I’m trying to manipulate some type to display blue when the corresponding slide in the slider is showing (its the ‘adapts to any home’ component). I know this code works because I’ve used it in a test environment (see below). But I can’t for the life of me get it to work within the webflow environment I keep getting errors of “Cannot read property ‘classList’ of undefined at blueApplier (velop:35)” But the element is defined. As I fetched from the DOM with get elementByClassName???

I’ve also tried several other methods such as getting the background colour etc, again I get these mysterious messages that the elements that work in my test environment are ‘undefined’. Here is my code (in the test environment) the live site (where it fails) and a read only link.

Live site: https://www.linksys-store-in-store.com/velop

https://preview.webflow.com/preview/linksys-store-in-store?utm_medium=preview_link&utm_source=designer&utm_content=linksys-store-in-store&preview=1cbbd59ef883d2891f236d154ac63091&pageId=5f1861c7aaa354c34c12aac3&mode=preview