Re: Absolute coordinates of DOM element within document I suppose you have passed an element's ID not the element itself - that is why it returns wrong result. I have added a little piece of code at the beginning of this function to make it work both for elements themselves and for their IDs as well. If it ...