I know about element.getBoundingClientRect()
. It returns a DOMRect
that contains the element including padding and border. How can I get a similar thing which does not include the padding and border?
I want to know where the content of the element begins and ends (relative to the viewport ideally).