jQuery position () Method
The jQuery position () method makes you able to retrieve the current position of an element relative to the parent element. It returns the position of the first matched element. This method returns the object with two properties: top and left position in pixels.
Example :
<!DOCTYPE html>
<title>jQuery position() Method</title>
<script src="js/jquery-3.2.1.min.js"></script>  
<script type="text/javascript">
        var x = $("p").position();
        alert("Top position: " + x.top + " Left position: " + x.left);
<style type="text/css">
.btn{ padding:6px 15px;}
<strong>Dummy Text :</strong> Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
when an unknown printer took a galley of type and scrambled it to make a type specimen book.

<button type="button" class="btn">Click Here! ( position() )</button>
Output :