elements is actually a plain NodeList
and element is just an HTMLElement

I think it is better to use offsetWidth