Get element offset in JavaScript

from blog Muffin Man, | ↗ original
When we left jQuery behind and embraced modern JavaScript frameworks, we thought we would never touch DOM directly again. Well that is not entirely true. There are a lot of cases when you need to get some DOM element size. For element's dimensions .offsetWidth and .offsetHeight are great way to do it. But one of the other common tasks is getting...