1 var div = document.getElementById("myDiv");
2 var rect = div.getBoundingClientRect();
3 x = rect.left;
4 y = rect.top;
5 w = rect.width;
6 h = rect.height;
1// Return the size of an element and its position relative to the viewport:
2
3const rect = obj.getBoundingClientRect();
4console.log(rect)