Without jQuery, go this way:
var children = document.getElementById('container').children;
var totalWidth = 0;
for (var i = 0; i < children.length; i++) {
totalWidth += parseInt(children[i].offsetWidth, 10);
}
To check whether you need offsetWidth
or something else see
Stackoverflow - Understanding offsetWidth, clientWidth, scrollWidth and -Height, respectively