If you want to add stuff to an element you should using the DOM with
createElement and appendChild, adding to innerHTML is totally
inefficient as then the old content is reparsed.
As for div elements they are block elements so just because you add some
text to a block element its block width does not change as it it not
determined by the text content but by the width of the container block.
And changing the text content of an inline <span> element with Mozilla
correctly changes its offsetWidth:
var span = document.createElement('span');
span.innerHTML = '<strong>Kibology for all.</strong>';
document.body.appendChild(span);
alert(span.offsetWidth);
span.innerHTML += '<strong>All for Kibology.</strong>';
alert(span.offsetWidth);
--
Martin Honnen
http://JavaScript.FAQTs.com/