determine height and width of dynamic html element by jquery
<p>suppose i have one js variable and my html data is stored into it like</p>

<pre><code>var data = '&lt;div id="tst"&gt;here will be my othere html&lt;/div&gt;'
</code></pre>

<p>in this case can i determine that what would be height &amp; width of div tst using jquery?</p>

<p>one guy give me solution like</p>

<pre><code>var $test = $(data).appendTo('body');
var size;

window.setTimeout(function(){
 size = {
     height: $test.height(),
     width: $test.width()
 };
 $test.remove();
}); 
</code></pre>

<p>but the above code looks bit complicated. if anyone know easy solution then please give me a sample code to do so. thanks</p>
