My element has the following CSS style:
#span {
position: absolute;
top: 100px;
left: 10px;
}
Is there a way to read the position
type with JavaScript? I've tried these two approaches:
document.getElementById("span").getBoundingClientRect()
document.getElementById(id).style.position
Neither fetches the position
. Is there a better way to go about doing it or an actual way to do it?