Get javascript to write text exactly where it is
<p>is it possible to get javascript to output html where the javascript code is?</p>

<p>For example</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;
&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;header&lt;/div&gt;
&lt;div&gt;main

&lt;script type="text/javascript" language="javascript"&gt;
// print some html here, maybe &lt;a href="http://www.google.com"&gt;google&lt;/a&gt;
&lt;/script&gt;

&lt;/div&gt;
&lt;div&gt;footer&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Where the end results would look like:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;
&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;header&lt;/div&gt;
&lt;div&gt;main&lt;a href="http://www.google.com"&gt;google&lt;/a&gt;&lt;/div&gt;
&lt;/script&gt;

&lt;/div&gt;
&lt;div&gt;footer&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I understand that I can give the containing div and id and then get javascript to insert the anchor take like that, but I just wanted to know if it's possible to do this directly, as in write the html exactly where the javascript is?</p>
