SyntaxFix
Write A Post
Hire A Developer
Questions
If the child takes the full width of the container excluding scrollbar (the default), then you can subtract the widths:
var child = document.querySelector(".somethingBig"); var scrollbarWidth = child.parentNode.offsetWidth - child.offsetWidth;