Can I check css height property with dom and manipulate it?

İf the height proporty is equal a value than i want to change someting. Bu it didn’t work.
sample code

Instead of looking at the style property of the element, why not use the offsetHeight property of the element itself?

i am still learning dom and never used offsetHeight, i am making a accordion menu and i tought like in the sample code but didn’t work.