You could use the function .getBoundingClientRect() to get the bounding box. Then, use height, width, top and left values to find the center position of your element.
Refer to https://developer.mozilla.org/es/docs/Web/API/Element/getBoundingClientRect