title: Dynamic width of DIV (offsetWidth issue)
body: <p>I face issue with retrieving (via javascript) width of the div which content is changed (just before reading the widht via offsetWidth) in dynamic way (via changing innerHTML or using createTextNode).</p>
  
  <p>Here is some sample code:</p>
  
  <pre><code>var con = document.getElementById('avContent'); //content div within page
  
  var temp = document.createElement('div');&lt;br /&gt; 
  var text1 = document.createTextNode('CCCCC');&lt;br /&gt; 
  temp.appendChild(text1);&lt;br /&gt; 
  con.appendChild(temp);&lt;br /&gt; 
  var length1 = temp.offsetWidth;&lt;br /&gt; 
  var text2 = document.createTextNode('CCCCC33333333vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv');&lt;br /&gt; 
  temp.removeChild(text1);&lt;br /&gt; 
  temp.appendChild(text2);&lt;br /&gt; 
  con.removeChild(temp);&lt;br /&gt; 
  con.appendChild(temp);
  var length2 = temp.offsetWidth;&lt;br /&gt; 
  </code></pre>
  
  <p>The length1 and length2 do have the same width.. (the same result I get while using innerHTML instead of createTextNode).</p>
  
  <p>Looks like it's the same issue like described in following discussion:<br /> 
  <a href="http://www.webdeveloper.com/forum/showthread.php?t=187716" rel="nofollow noreferrer">http://www.webdeveloper.com/forum/showthread.php?t=187716</a></p>
  
  <p>Does anybody have answer (work around)?<br /> 
  Thanks much for help in advance.</p>