title: How to find the X and Y coordinates of a div element on-screen?
body: <p>So I have a <code>div</code> element that gets animated when you hover over it. I want to detect when the div element leaves the point <code>0, 0</code>, and when it returns to <code>0, 0</code>. I have the base code already, I just don't know the variables I would plug in.<br></p>
  
  <pre><code>var divx = getElementById("div").position.x;
  var divy = getElementById("div").position.y;
  if (divx === 0 &amp;&amp; divy === 0) {
      window.alert("Div has returned to starting position")
  </code></pre>
  
  <p>And to finish off, I am just starting HTML and JavaScript, so if this is a super obvious solution, then I guess I'll have to go do more reasearch.</p>