How to get an DOM Element [x,y] coordinates in javascript? Specifically, the coordinates of a button inside a scrollbox.
I found this offsetLeft attribute:
var elements = scroll.children; // with 12 children
if (!elements.item(2)) {
print("no element");
}
else if (!elements.item(2).offsetLeft) {
print("no attribute");
}
else {
print(elements.item(2).offsetLeft);
}
but it's printing "no attribute"...
By the way, it's for Mozilla environment.