title: How can I track mouse move events in javascript once the cursor is off of the target element?
body: <p>I can get mouse motion events in javascript using a simple function:</p>
  
  <pre><code>myElement.onmousemove(function(event){
    // ...
  });
  </code></pre>
  
  <p>but I think those events only fire when the cursor is hovering over the element. I know I can also do this for <code>document</code> and get all mouse motion events:</p>
  
  <pre><code>document.onmousemove(function(event){...});
  </code></pre>
  
  <p>However, this event doesn't have the "scope" of belonging to the div or button or whatever, and won't have an offset relative to the element I'm working with.</p>
  
  <p>My workaround is to save a variable pointing at the focused div and reference it when getting all motion events, but I'd much rather get motion events and the onmousemove function set for the element itself. Is there a way for that element to continue receiving mouse move events even if the cursor leaves the boundary of the element?</p>
  
  <p>In case it matters I can use jQuery but I would prefer a native solution.</p>