Javascript document write
<p>How do I get this javascript to populate the textarea?</p>

<pre><code>&lt;body onload="form1.submit();"&gt;&lt;div align="center"&gt;Loading...&lt;/div&gt;
&lt;script type="text/javascript" src="&lt;%= g_page_site_actual %&gt;/js/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="&lt;%= g_page_site_actual %&gt;/js/jquery.wordstats.js"&gt;&lt;/script&gt; &lt;!-- core code --&gt;
&lt;script type="text/javascript" src="&lt;%= g_page_site_actual %&gt;/js/jquery.wordstats.en.js"&gt;&lt;/script&gt; &lt;!-- English stop words --&gt;
&lt;script type="text/javascript"&gt;
        $(function() {
            var count = 20;
            $.extend($.wordStats.stopWords, {'retrieved': true, '2007': true});
            $.wordStats.computeTopWords(count);
            var msgcounttext1 = '&lt;%=completehtml%&gt;'
            for(var i = 0, j = $.wordStats.topWords.length; i &lt; j &amp;&amp; i &lt;= count; i++) {
               msg += $.wordStats.topWords[i].substring(1) + ', ';
            }
            {
            document.form1.textarea.value = document.write(msgcounttext);
            }
            $.wordStats.clear();
        });
        &lt;/script&gt;
&lt;div id="content" class="hidden"&gt;&lt;%=completehtml%&gt;
    &lt;form id="form1" name="form1" method="post" action="test.asp"&gt;
        &lt;textarea name="textarea" id="textarea" cols="45" rows="5"&gt;&lt;/textarea&gt;
    &lt;/form&gt;
  &lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>Thanks</p>
