offsetWidth returns 0, but console in dev tool gives the correct value
I'm trying to understand why my tabActive.offsetWidth is 0 while I type exactly that code into console of dev tool and it returns 135. Anyone's been to the same problem? :( here is the image of my code