title: how to get pixel coordinates of an element on computer screen
body: <p>I would like to know the left and top position of an html element on the screen.
  I tried with this code that gives me the position of an element inside a document:</p>
  
  <pre><code>var position = $('#elem').position();
  </code></pre>
  
  <p>but what I want is to know if there is a function that finds the position on the screen, or if there is a way to know the coordinates of this point on the screen: <img src="https://i.stack.imgur.com/l9pXc.png" alt="enter image description here"></p>
  
  <p>Thank you in advance!</p>