title: Get offset right in vanilla JavaScript
body: <p>How do I get the offset of an element from the right side, relative to the <code>window</code>?</p>
  
  <p>I can only find jQuery solutions but I need a solution using vanilla JavaScript.</p>
  
  <p>This is the solution using jQuery</p>
  
  <pre><code>var rt = ($(window).width() - ($whatever.offset().left + $whatever.outerWidth()));
  </code></pre>
  
  <p>How do I translate this to vanilla JavaScript?</p>