I am getting some html and inserting it with .html(), after which I am trying to get the width of one of newly inserted elements with .width() (which h
.html()
.width()
// ... $('.box', boxOutput).each(function(i) { //boxWidth += $(this).width(); /* this is where sometimes width returns 0 */ boxWidth += this..getBoundingClientRect().width; }); //...