Dapatkan Posisi Komponen JavaScript

let elem = document.getElementById('id_my_component');
let rect = elem.getBoundingClientRect();
console.log("x: "+ rect.x);
console.log("y: "+ rect.y);
Cerbrain