title: How to get xy coordinates of child element from parent element in jquery?
body: <p>How to get xy coordinates of child element from parent element, and not the(body)? How to get x value from DIV B to DIV A, so when window resizes, the values stay true???</p>
  
  <p><img src="https://i.stack.imgur.com/QLw5z.png" alt="enter image description here"></p>
  
  <pre><code>var startPos = $("#divB").position();
  $("#divB").draggable({ 
       containment: 'parent',
       stop: function(event, ui) {
          var stopPos = $(this).position();
          $("#firstInput").val((stopPos.left - startPos.left));
       }
  });
  </code></pre>
  
  <p>Is there a method to get this values directly and not from xy coordinates of whole screen?</p>