[TypeScript] Property 'offsetTop' does not exist on type 'Element'
December 7, 2022
The error “Property ‘offsetTop’ does not exist on type ‘Element’” occurs when we try to access the offsetTop property on an element that has a type of Element. To solve the error, use a type assertion to type the element as HTMLElement before accessing the property.