JavaScript Tutorial

offset()

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>offset demo</title>
  <style>
  p {
    margin-left: 10px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<p>Hello</p><p>2nd Paragraph</p>
    <script>
        var p = $( "p:last" );
        var offset = p.offset();
        p.html( "left: " + offset.left + ", top: " + offset.top );
    </script>
</body>
</html>