Is possible with javascript/jquery to get the top position of an element?
The element is a table, if that matter.
Is possible with javascript/jquery to get the top position of an element?
The element is a table, if that matter.
document.getElementById("elem").style.top is how you reach this in JS.
$("#myTable").offset().top;
This will give you the computed offset (relative to document) of any object.
If you want the position relative to the document then:
$("#myTable").offset().top;
but often you will want the position relative to the closest positioned parent:
$("#myTable").position().top;